Using a Summary Form to Support Local Processing : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Using a Summary Form to Support Local Processing



<HTML>
<HEAD>
<TITLE>Submitting the results of local form processing</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
function processOrder() {
 order = ""
 order += document.orderForm.model.selectedIndex
 order += document.orderForm.doors.selectedIndex
 order += document.orderForm.color.selectedIndex
 sel = document.orderForm.accessories
 for(i=0;i<sel.length;++i)
    if(sel.options[i].selectedorder += i
 document.submitForm.result.value = order
 document.submitForm.submit()
 return false
}
// --></SCRIPT>
</HEAD>
<BODY>
<H1>Select your next car:</H1>
<PRE>Model           Doors     Color    Accessories</PRE>
<FORM ACTION="" NAME="orderForm"ONSUBMIT="return processOrder()">
<SELECT NAME="model" SIZE="3">
<OPTION>A</OPTION>
<OPTION>B</OPTION>
<OPTION>C</OPTION>
<OPTION>D</OPTION>
</SELECT>
<SELECT NAME="doors" SIZE="3">
<OPTION>2</OPTION>
<OPTION>4</OPTION>
</SELECT>
<SELECT NAME="color" SIZE="3">
<OPTION>red</OPTION>
<OPTION>white</OPTION>
<OPTION>blue</OPTION>
<OPTION>black</OPTION>
<OPTION>brown</OPTION>
<OPTION>silver</OPTION>
<OPTION>pink</OPTION>
</SELECT>
<SELECT NAME="accessories" SIZE="3" MULTIPLE="MULTIPLE">
<OPTION>Z</OPTION>
<OPTION>X</OPTION>
<OPTION>Y</OPTION>
<OPTION>U</OPTION>
<OPTION>R</OPTION>
</SELECT>
<P><INPUT TYPE="SUBMIT" NAME="order" VALUE="I'll take it!"></P>
</FORM>
<FORM ACTION="http://www.navioo.com" METHOD="GET" NAME="submitForm">
<INPUT TYPE="HIDDEN" NAME="result">
</FORM>
</BODY>
</HTML>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Option Select ComboBox