Passing Select Values 
Author Message
 Passing Select Values

I have the following form in which values are passed to an xml file via ASP
(e.g. request("mainlist"). In the form are two javascript select boxes, the
items in sublist dependent on what is shown in mainlist. The select boxes
work great however I need the description of mainlist and sublist vice the
values to be passed. The values of NAME, EMAIL, PHONE, etc. are being sent
fine but I can't for the life of me get the description from the select
boxes. Please help.

<form method=post action="processgb.asp" name="form1">
<SCRIPT LANGUAGE="javascript">
<!--
var page=""
var i;
// call the function that fills in the arrays so we'll use them to fill the
select
PrepareData();
page+="Select the main list: ";
page+="<SELECT NAME='mainlist' onChange='reFillList()'>";
for (i=0;i<MainList.length;i++) {
 page+="<OPTION VALUE="+MainList[i].nvalue;
 if (i==0) {
  page+=" SELECTED ";
 }
 page+=">"+MainList[i].description;

Quote:
}

page+="</SELECT>";
document.write(page);

//-->
</SCRIPT>
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
Select SubList:

<SELECT NAME='sublist'>
<SCRIPT LANGUAGE="javascript">
<!--
// since we have selected the first value in the main list, we have to fill
this list
reFillList();

//-->
</SCRIPT>

</SELECT>
<br />

<table border = 1>
  <tr>
    <td>

<table class="guest">
 <tr>
       <td align="RIGHT">Name:</td>
       <td><input type=text Name="NAME" maxlength="30"></td>
     </tr>
     <tr>
       <td align="RIGHT">Email:</td>
       <td><input type=text name="EMAIL" maxlength="50"></td>
     </tr>
     <tr>
       <td align="RIGHT">Phone:</td>
       <td><input type=text name="PHONE" maxlength="15"></td>
     </tr>
     <tr>
       <td align="RIGHT" valign="TOP">Description:</td>
       <td><textarea name="DESCRIPTION" cols="30" rows="7"></textarea>
       <input type=submit value="Send To Sunshine Arcade">
       </td>
     </tr>

</table>

</td>
  </tr>
 </table>

</form>



Sun, 28 Sep 2003 22:05:10 GMT  
 Passing Select Values

Paul,

I guess if you are already using ASP, it is much easier to use an ASP
combo(select)boxes

Check www.w3schools.com (/asp) for more details.

HIH,

Peter



I have the following form in which values are passed to an xml file via ASP
(e.g. request("mainlist"). In the form are two javascript select boxes, the
items in sublist dependent on what is shown in mainlist. The select boxes
work great however I need the description of mainlist and sublist vice the
values to be passed. The values of NAME, EMAIL, PHONE, etc. are being sent
fine but I can't for the life of me get the description from the select
boxes. Please help.
<form method=post action="processgb.asp" name="form1">
<SCRIPT LANGUAGE="javascript">
<snip>

</script>



Sun, 28 Sep 2003 23:38:09 GMT  
 Passing Select Values
Perhaps but I only use it to get the contents of the form which I have in
JavaScript and use in several other places. The ASP makes is easy except in
this case to retrieve the values and write them to the xml file.

Thanks



Mon, 29 Sep 2003 00:16:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing SELECT values to ASP

2. Passing SELECT Values to ASP

3. Please Help - Passing SELECT values to ASP

4. Passing value from select box to next page

5. Making a value selected in a select box.

6. How to select values from group of select lists

7. Passing an entire SELECT box wi/Jscript

8. ?Selecting/Indexing Options elements by Name value

9. HOW to add VALUES to COMBOBOX (HTML SELECT)at run time on CLIENT SIDE using VBSCRIPT

10. how to put value in SELECT control?

11. Add a value to a select tag

12. changing select options based on text value in another field

 

 
Powered by phpBB® Forum Software