drop down list/menu form submit

Discussion in 'Javascript' started by kevin, Oct 17, 2006.

  1. kevin

    kevin Guest

    I was wondering using only javascript i am trying to figure this out. Lets
    say i have a drop down menu with the following items in it\


    <form id='frmitems' name='frmitems' method='post' action=''>
    <select name='select'>
    <option value='A'>Item A</option>
    <option value='B'>Item B</option>
    <option value='C'>Item C</option>
    <option value='D'>Item D</option>
    </select>
    </form>


    What i want to happen is when i select Item C it will submit the form and
    Item C will be selected. This is going to be done by using javascript only.
    Can somebody shed some light on this.


    Thanks everybody in advanced who helped :
     
    kevin, Oct 17, 2006
    #1
    1. Advertisements

  2. kevin

    chonny Guest

    <form id='frmitems' name='frmitems' method='post' action='' >
    <select name='select' onchange='document.frmitems.submit();'>
    <option value='A'>Item A</option>
    <option value='B'>Item B</option>
    <option value='C'>Item C</option>
    <option value='D'>Item D</option>
    </select>
    </form>
    hope this help
     
    chonny, Oct 17, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.