473,508 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submit buttons - changing behaviour

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,
Jul 20 '05 #1
2 2422
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" <bl*******@lexon.ws> wrote in message
news:Px*********************@newssrv26.news.prodig y.com...
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,

Jul 20 '05 #2
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" <bl*******@lexon.ws> wrote in message
news:Px*********************@newssrv26.news.prodig y.com...
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.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4962
by: Xeon | last post by:
Ok, the subject seemed not PHP related, but it does, as the submitted form will be read/processed by PHP. I have this HTML code: <form method="post" action="foo.php"> <select name="blah"...
3
6577
by: Nicolas Keller | last post by:
Hi! I'm used to have Mozilla for testing my PHP sites when I'm coding. The site's nearly finished, now I've made a test with the Internet Exlporer... guess what... failed. The problem: I'm...
17
2741
by: Dave Smithz | last post by:
Hi there, A PHP application I built has a section which lists a number of members to a club whose names each appear with a check box beside them that can be ticked. These check boxes are part...
3
4336
by: John Dunlop | last post by:
(Note crosspost and follow-ups to ciwah.) Nicolas Keller wrote in thread "Differences in form handling btw Mozilla and IE?": > The problem: I'm using a form that submit's (POST) its data via...
6
3079
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
6
2725
by: charlie_M | last post by:
I figured out via various help from this forum... EXAMPLE: onClick="document.forms.MYBUTTON.value='SIMPLE';document.forms.submit()" In my CGI I see "MYBUTTON" = "SIMPLE" and this works...
3
2549
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
5
2626
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze...
26
2878
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.