without pressing any buttons???

Discussion in 'Javascript' started by Cem Louis, Oct 11, 2004.

  1. Cem Louis

    Cem Louis Guest

    Hi,

    I have a page with 4 radiobuttons on it and no buttons on it. I want
    to post the value of the selected radio button to the other page
    without pressing any buttons (with only selecting the radio button)
    How can I accomplish this??? I made a code block like below but
    couldn't make it work???

    Thank you,
    Cem Louis

    <html>
    <head>
    </head>
    <SCRIPT LANGUAGE="Javascript">
    function Submit(){
    document.getElementById("form1").Submit()
    }
    </SCRIPT>
    <form name="form1" method="post" action="process.php">
    <input name="radiobutton" type="radio" value="radiobutton"
    onClick="Submit()">Apple<br>
    <input name="radiobutton" type="radio" value="radiobutton"
    onClick="Submit()">Banana<br>
    <input name="radiobutton" type="radio" value="radiobutton"
    onClick="Submit()">Peach<br>
    <input name="radiobutton" type="radio" value="radiobutton"
    onClick="Submit()">Melon
    </form>
    Cem Louis, Oct 11, 2004
    #1
    1. Advertising

  2. Cem Louis

    McKirahan Guest

    "Cem Louis" <> wrote in message
    news:...
    > Hi,
    >
    > I have a page with 4 radiobuttons on it and no buttons on it. I want
    > to post the value of the selected radio button to the other page
    > without pressing any buttons (with only selecting the radio button)
    > How can I accomplish this??? I made a code block like below but
    > couldn't make it work???
    >
    > Thank you,
    > Cem Louis
    >
    > <html>
    > <head>
    > </head>
    > <SCRIPT LANGUAGE="Javascript">
    > function Submit(){
    > document.getElementById("form1").Submit()
    > }
    > </SCRIPT>
    > <form name="form1" method="post" action="process.php">
    > <input name="radiobutton" type="radio" value="radiobutton"
    > onClick="Submit()">Apple<br>
    > <input name="radiobutton" type="radio" value="radiobutton"
    > onClick="Submit()">Banana<br>
    > <input name="radiobutton" type="radio" value="radiobutton"
    > onClick="Submit()">Peach<br>
    > <input name="radiobutton" type="radio" value="radiobutton"
    > onClick="Submit()">Melon
    > </form>


    Try lowercase "s" for ".submit()".
    McKirahan, Oct 11, 2004
    #2
    1. Advertising

  3. Cem Louis

    Ivo Guest

    "McKirahan" wrote
    > "Cem Louis" wrote
    > > <input name="radiobutton" type="radio" value="radiobutton"
    > > onClick="Submit()">Melon
    > > </form>

    >
    > Try lowercase "s" for ".submit()".


    And just for the sake of completeness and crossbrowserness, you might
    as well write it in full:

    onclick=" this.form.submit(); "

    --
    Ivo
    Ivo, Oct 11, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mg
    Replies:
    5
    Views:
    1,023
    Vikram.NET
    Jul 14, 2003
  2. paul
    Replies:
    1
    Views:
    507
    Jonathan Mcdougall
    Aug 4, 2003
  3. Replies:
    3
    Views:
    359
    Maulik
    Jun 8, 2007
  4. qa4ever
    Replies:
    3
    Views:
    242
  5. Shocky
    Replies:
    20
    Views:
    277
Loading...

Share This Page