1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using javascript to replace the "submit" function of a HTML form

Discussion in 'JavaScript' started by Tamarack, May 2, 2007.

  1. #1
    Looking for help with JavaScript - any assistance appreciated.

    I have a pull down box with a list of items to be selected. Next to it is a "Go" button. I want to remove the need to hit the "go" button so the submit for the form happens as soon as the user makes a selection.

    see it here

    I have found examples on the web for going to another page but not replacing the "sumbit" function of a HTML form. I am decent with php but know little about javascript. I realize I cannot do this with php as is not client side so I have to use javascript (or?)

    Your assistance is appreciated!!
     
    Tamarack, May 2, 2007 IP
  2. void

    void Peon

    Messages:
    119
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <form name="yourform" ...

    <select onchange="document.forms['yourform'].submit()" ...
     
    void, May 2, 2007 IP
    Tamarack likes this.
  3. Tamarack

    Tamarack Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you void - that was too easy!
     
    Tamarack, May 2, 2007 IP
  4. void

    void Peon

    Messages:
    119
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No prob :)
     
    void, May 3, 2007 IP