PDA

View Full Version : Form Drop drown problem


TIA
06-22-2005, 04:07 PM
I want to create a form that allows user to select the type of search from a dropdown list and then enter the string to search for using a text field that posts to a results page with multiple record sets that are looking for a variable=value in the string.

The variable part comes from the dropdown list the string part comes from the text box.

<form name="myForm" method="Get" action="/ezlead/search/open_resultsA.asp">
<td width="161"><select name="select">
<option value="myValue1">Search1</option>
<option value="myValue2">Search2</option>
<option value="myValue3">Search3</option>
<option value="myValue4">Search4</option>
<option value="myValue5">Search5</option>
</select></td>
<td width="177">
<input name="myTextField" type="text" onFocus="this.value='';" id="myTextFieldValue" value="Your search string?"></td>
<td><input type="submit" name="Submit" value="Submit"></td>
<td width="1" colspan="2"></td>
</form>

Resulting URL
https://mysite.com/results.asp?select=myVal...g&Submit=Submit ('https://mysite.com/results.asp?select=myValue(n)&myTextFiledValue=some_string&Submit=Submit')
The problem is that this produces this:
select=myValue(n)&myTextFiledValue=some_string

When my results page is looking for something in the url string like:
“myValue(n)=some_string”
Where myValue(n) comes form the drop down and the some_string comes from the text field.

How would I create a variable that holds a value from the “option select” and places it in the “input name” attribute of the text field

<input name=myVariable type="text" onFocus="this.value='';" id="myTextFieldValue" value="Your search string?">

Or is there a better way?

Thank you for your help…