submit buttons - changing behaviour

Discussion in 'Javascript' started by Bartosz Wegrzyn, Sep 8, 2003.

  1. I do have a form with 4 submit buttons.
    Also I do have a script that checks that for for errors.

    Right now I have onsubmit() event for checki my form.
    After it is checked it runs my php script.

    My problem is that for one button I do not want to run that script.
    I want to be able to run it without validation.

    I tried to change the type of buttons for button instead of submit.
    That I added that action to onclick event = document.formname.submit()

    Problem is that when I do this the data is not posted to my php script and
    even not to my validation script. WHY???

    Can anyone help

    Bart,
    Bartosz Wegrzyn, Sep 8, 2003
    #1
    1. Advertising

  2. Bartosz Wegrzyn

    lallous Guest

    Hi,

    a)One reason for not having data being posted to your PHP script is that
    your submit button belongs to a form and your form data belongs to another
    form.


    b)try behind each button to do this:
    want_validate = true
    and for the button of validation exclusion type this:
    want_validate = false;

    then on the onsubmit code do this:
    if (want_validate) return doValidation() else return true;


    hope that helps,
    Elias

    "Bartosz Wegrzyn" <> wrote in message
    news:pxQ6b.21796$...
    > I do have a form with 4 submit buttons.
    > Also I do have a script that checks that for for errors.
    >
    > Right now I have onsubmit() event for checki my form.
    > After it is checked it runs my php script.
    >
    > My problem is that for one button I do not want to run that script.
    > I want to be able to run it without validation.
    >
    > I tried to change the type of buttons for button instead of submit.
    > That I added that action to onclick event = document.formname.submit()
    >
    > Problem is that when I do this the data is not posted to my php script and
    > even not to my validation script. WHY???
    >
    > Can anyone help
    >
    > Bart,
    >
    >
    lallous, Sep 8, 2003
    #2
    1. Advertising

  3. On Mon, 08 Sep 2003 11:36:57 +0300, lallous wrote:

    > Hi,
    >
    > a)One reason for not having data being posted to your PHP script is that
    > your submit button belongs to a form and your form data belongs to another
    > form.
    >
    >
    > b)try behind each button to do this:
    > want_validate = true
    > and for the button of validation exclusion type this:
    > want_validate = false;
    >
    > then on the onsubmit code do this:
    > if (want_validate) return doValidation() else return true;
    >
    >
    > hope that helps,
    > Elias
    >
    > "Bartosz Wegrzyn" <> wrote in message
    > news:pxQ6b.21796$...
    >> I do have a form with 4 submit buttons.
    >> Also I do have a script that checks that for for errors.
    >>
    >> Right now I have onsubmit() event for checki my form.
    >> After it is checked it runs my php script.
    >>
    >> My problem is that for one button I do not want to run that script.
    >> I want to be able to run it without validation.
    >>
    >> I tried to change the type of buttons for button instead of submit.
    >> That I added that action to onclick event = document.formname.submit()
    >>
    >> Problem is that when I do this the data is not posted to my php script and
    >> even not to my validation script. WHY???
    >>
    >> Can anyone help
    >>
    >> Bart,
    >>
    >>



    Thanks a lot. I did that and works fine.
    Bartosz Wegrzyn, Sep 8, 2003
    #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. Roger
    Replies:
    1
    Views:
    614
    GreggTB
    May 20, 2005
  2. =?Utf-8?B?QmVu?=

    Image Buttons/Buttons not responding

    =?Utf-8?B?QmVu?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    432
    Teemu Keiski
    Jul 6, 2005
  3. Replies:
    4
    Views:
    887
  4. Jeremy Jones

    Datagrid Nav buttons and numeric buttons

    Jeremy Jones, Mar 21, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    602
    Masudur
    Mar 22, 2007
  5. Jonathan N. Little
    Replies:
    3
    Views:
    514
    Andy Dingley
    Apr 2, 2007
Loading...

Share This Page