Results 1 to 2 of 2

Thread: change input name and value with dropdown list

  1. #1
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default change input name and value with dropdown list

    I'm a n00b so please forgive me if this is a stupid question or if the info is listed somewhere else. I really did try and find it on my own.

    I'm trying to make a form that searches my amazon astore. I found this html search box code for:

    <form action="http://astore.amazon.com/adbabel-20/search" method="get" target="_blank">
    <input name="node" value="8" type="hidden">
    <input name="keywords" size="12" value="" type="text">
    <button type="submit" >Search</button>
    </form>

    this results in the form submitting http://astore.amazon.com/adbabel-20/...de=8&keywords=keyword

    it works well but is limited to searching only one category in my store (i have several). each category is assigned a node value (in this case 8). By changing the node value in the code I can change which category in my astore that is searched.

    I want to create a drop down list that lists all of my catagories and changes the node value upon selection. Can anyone let me know how this might be done with dhtml or javascript (or html if it can be done that way)

    Thanks a million!

    here's a link to the code i posted about in action: http://www.adbabel.net/astore-search/script-html.html

  2. #2
    Join Date
    Nov 2008
    Posts
    58
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Default

    Update the code this way (by adding a select box)

    HTML Code:
    <form action="http://astore.amazon.com/adbabel-20/search" method="get" target="_blank">
    <select name="node" size='1'>
    <option value='1'>Category 1</option>
    <option value='2'>Category 2</option>
    <option value='3'>Category 3</option>
    <option value='8'>Category 8</option>
    </select>
    <input name="keywords" size="12" value="" type="text">
    <button type="submit" >Search</button>
    </form>
    More info:
    HTML form input examples

    HTML Form Tutorial

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
  •