Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    238
    Thanks
    9
    Thanked 0 Times in 0 Posts

    form text input default value?

    Hi,
    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?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,786
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    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" />

  • Users who have thanked VIPStephan for this post:

    htcilt (01-16-2008)

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    238
    Thanks
    9
    Thanked 0 Times in 0 Posts
    many thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •