![]() |
![]() |
||||||
|
|||||||
| Tags: doing, passing, url, variable, wrong |
![]() |
|
|||
|
I've made a form and am attaching the code.
Basically I am trying to get a list of offices and select one (which I am able to do when I publish and run the webpage/form). However, it always passes the value of "1" (the first record) to the next page (no matter what office I select from the drop down menu). I've tried the other choices under the lightning bolt, but those won't pass anything to the next page. Help! <cfquery name="rs_offices" datasource="TAXCAMPAIGN"> SELECT * FROM dbo.Offices </cfquery> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action="test2.cfm?OfficeID=<cfoutput>#IIf(isDefine d("Form.OfficeID"),"Form.Offic eID",DE(""))#</cfoutput>"> <p>Select an office:</p> <p align="center"> <select name="OfficeID" id="OfficeID"> <cfoutput query="rs_offices"> <option value="#rs_offices.OfficeID#">#rs_offices.OfficeNa me#</option> </cfoutput> </select> </p> <p align="center"> <input type="submit" name="OfficeID" id="OfficeID" value="Continue" /> </p> </form> </body> </html> |
| Sponsored Links |
|
|||
|
Why are you passing OfficeID as an URL variable in the form action when it is
already a FORM variable (the SELECT form field)? The selected OfficeID will be passed to test2.cfm in the FORM scope. Also, you have named the submit button OfficeID, too. Form field names need to be unique, except possibly radio buttons and checkboxes. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise