473,409 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

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 2420
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.