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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HREF onclick in search form

    I'm trying to figure out how to add a typed search variable to the end of a url string with the follow code:

    [CODE]
    <form action="" id="search-form">
    <div class="rowElem"><strong>
    <input type="text" value="Enter Artist, Team, or Venue"></strong>
    <a href="#" onclick="document.getElementById('search-form').submit()"> <span><span>search</span></span></a></div>
    </form>
    [CODE]

    The URL would be something like Results.html?kwds='whatever searched'

    I've tried everything

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,187
    Thanks
    15
    Thanked 253 Times in 253 Posts
    Your form is not complete enough to do what you want. Here is a more complete one that works. It doesn't involve any javascript but you can add javascript, php or whatever to act on the changed URL.
    Code:
    <form action="" method="get" id="search_form" name="search_form">
    
    <input type="text" value="Enter_Artist" name="myform">
    
    <input type="submit" value="Search">
    
    </form>


  •  

    Tags for this Thread

    Posting Permissions

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