SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML Form Question

    Hi guys,

    I have a form that allows a user to search, when submitted it displays the information below the form. The users have requested that after they click Submit, that the information they input into the search text area, remains there after they click submit. They would also like to have a "Clear" button to remove the text if needed to input additional searches.

    How would I go about setting this up?

    Thanks,
    Aaron

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,313
    Mentioned
    178 Post(s)
    Tagged
    9 Thread(s)
    Hi there,

    Welcome to the forums!

    You can do this using JavaScript.
    The exact code you need would depend on exactly what elements you have in your form.
    Here is a good tutorial: http://www.javascript-coder.com/java...set-form.phtml

    Maybe you can have a look at that and post back here if you have any questions.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Depending on which server side language you are using with the form it is simply a matter of setting the form field values from the fields passed with the form. Only the clear button functionality would require JavaScript (although JavaScript could be used to process the form without having to reload the page.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,313
    Mentioned
    178 Post(s)
    Tagged
    9 Thread(s)
    Oops, I missed the first part of the question.
    Thanks felgall!


Bookmarks

Posting Permissions

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