submit buttons - changing behaviour

  • Thread starter Bartosz Wegrzyn
  • Start date
B

Bartosz Wegrzyn

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,
 
L

lallous

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
 
B

Bartosz Wegrzyn

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


Thanks a lot. I did that and works fine.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top