View Full Version : Form Drop drown problem

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>
<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>

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:

When my results page is looking for something in the url string like:
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…