View Full Version : form text input default value?

01-16-2008, 11:44 AM
I have a form with a keywords textbox. This then is submitted to a search results page based on what is typed in the textbox. "keywords=" is carried in the URL.
Is there a way to have a default value of a textbox (in the same way as doing option value="defaultvaluehere" selected="selected" in a drop down menu) so that if the user doesn't type anything in the box, the specified value gets carried in the URL, but is not visible in the textbox?
Hope this makes sense?

01-16-2008, 11:49 AM
Default value is done with <input type="text" value="hello" />. However, a hidden default value is probably best passed with a hidden input field: <input type="hidden" value="hello" />

01-16-2008, 12:02 PM
many thanks!