|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need a form that the first field is a drop-down box specifying which page the form will submit to, and two other text fields to be submitted to that page.
So far, I can get the first problem to work using: "location = '' + document.navform.inchoice.options[ document.navform.inchoice.selectedIndex ].value" But the data from the second and third fields doesnt flow thru to the page intended. Please Help! Thanks, Josh |
|
#2
|
|||
|
|||
|
you cant really have the action of the form (where it will submit to) as a dynamic variable. IT has to be set. You CAN however, submit your form to a 'middle' page that will process the data and then redirect to the page you selected in the list.
so have the first form submit to a processing page that will stick the form vbariables you selected into another form as hidden inputs, and have the form action equal to the page you selected from the drop down list. OR you could a javascript to do it all for you like this: <form name="myformname"> <input type="text" name="myFormText1"> <input type="text" name="myFormText2"> <select name="page" onSelect="location.href = document.myformname.page.value + '?myFormText1=' + document.myformname.myFormText1.value + '&myFormText2=' + document.myformname.myFormText2.value ;"> <option value="page1.html">page1</option> .... </form> WHen you select a choice from the dropdown selection..it will relocate you to the page you selected and add the 2 textfeilds to the query string that it sends to the page. FOr instance, if you select option 1 of the drop down, you will go to page1.html?myformText1=_____&myFormText2=_____ where ___ are the values you entered in the text fields. [This message has been edited by velvEtY (edited October 24, 2000).] |
|
#3
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by velvEtY:
you cant really have the action of the form (where it will submit to) as a dynamic variable. IT has to be set. You CAN however, submit your form to a 'middle' page that will process the data and then redirect to the page you selected in the list. so have the first form submit to a processing page that will stick the form vbariables you selected into another form as hidden inputs, and have the form action equal to the page you selected from the drop down list. OR you could a javascript to do it all for you like this: <form name="myformname"> <input type="text" name="myFormText1"> <input type="text" name="myFormText2"> <select name="page" onSelect="location.href = document.myformname.page.value + '?myFormText1=' + document.myformname.myFormText1.value + '&myFormText2=' + document.myformname.myFormText2.value ;"> <option value="page1.html">page1</option> .... </form> WHen you select a choice from the dropdown selection..it will relocate you to the page you selected and add the 2 textfeilds to the query string that it sends to the page. FOr instance, if you select option 1 of the drop down, you will go to page1.html?myformText1=_____&myFormText2=_____ where ___ are the values you entered in the text fields. [This message has been edited by velvEtY (edited October 24, 2000).][/quote] Well, I can already make it post to the page selected in the drop down box, but I can not get the text fields to post to that page..... Maybe I'm just confused!!! |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Form Field Trouble |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|