
cclinton
User
Sep 1, 2006, 11:39 AM
Post #1 of 6
(6117 views)
Shortcut
|
|
changing default search values - or hiding them
|
Can't Post
|
|
Anyone know how to make a value appear in the search field (text field) of the search form but not go through the search process as an actual value? In other words, I want to build a skinny search form on my site. To keep the form small, I don't want to list the titles next to the form fields nor above the fields. Instead, I want to place the name of the field in the field itself. This works with drop downs as I can give the first option an empty value. Thus choosing this does not send anything to the search script. Example: <select name="hfield10_keyword"> <option value="">Choose an Office <option>Carson <option>Cerritos </select> When they select the first option or don't change it, no keywords are sent to through the script for lfield10. I am trying to determine how to do this with text fields. As an example, let's use the city search field, in this case lfieldx. I'd like to have city appear in the field and, when they click on it, city disappears allowing them to enter the name of a city. If they decide to not enter a city, I want the word city (the default value in the field) to have an empty value. I already determined how to make the value disappear when clicking in the field: <SCRIPT> <!-- Begin document.write('<input type="text" size="22" name="lfieldx_keyword" value="City" onFocus="if(this.value==\'City\')this.value=\'\'\" />'); // End --> </SCRIPT> The problem is that anyone NOT entering a city forces the keyword city through the script for lfieldx. Any ideas?
|