473,322 Members | 1,806 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,322 software developers and data experts.

Page Submits Twice

Hi

Here is the sample code for my form, but problem is that it submitts
twice in some cases when i click sub mit button.
<script>
function validateform (){
//do a lot validation here, if validation failes, return false;

//finaly this line
return true;
}
</script>

<form name="abc" action="any other apge" onsubmit = "return
validateform();">

<input type="submit" name="save" id="save">
</form>

Can any one help me?

Feb 24 '06 #1
5 2419

Umesh wrote:
Hi

Here is the sample code for my form, but problem is that it submitts
twice in some cases when i click sub mit button.
<script>
function validateform (){
//do a lot validation here, if validation failes, return false;

//finaly this line
return true;
}
</script>

<form name="abc" action="any other apge" onsubmit = "return
validateform();">

<input type="submit" name="save" id="save">
</form>

Can any one help me?


You need to ask this in a javascript forum. It's a client side problem
- ASP is purely server side.

/P.

Feb 24 '06 #2
Any way! thanks for suggestion

Feb 24 '06 #3
<script>
var isSubmitted = false;
function validateform (){
//do a lot validation here, if validation failes, return false;
//finaly this line
if (!isSubmitted)
isSubmitted=true;
return true;
else
return false;
}
</script>

<form name="abc" action="any other apge" onsubmit = "return validateform();">
<input type="submit" name="save" id="save">
</form>
Feb 25 '06 #4
Hi ! Thanks for your time.

I am not able to understand why this probelm occured. can u elaborate
more.

**Note submit button is clicked only once.

Feb 25 '06 #5
dNagel wrote on 25 feb 2006 in microsoft.public.inetserver.asp.general:
if (!isSubmitted)
isSubmitted=true;
return true;
else
return false;


=== Do not forget the {}

....
if (!isSubmitted) {
isSubmitted=true;
return true;
}
else
return false;
....

=== why use "else":

....
if (!isSubmitted) {
isSubmitted=true;
return true;
}
return false;
....

=== why use an "if":

....
var x = isSubmitted
isSubmitted = true
return !x
....

;-}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 25 '06 #6

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

Similar topics

15
by: wk6pack | last post by:
Hi, I have a problem and not quite how to go about solving it. I have a form written in asp. I wish to submit the form and have the server return back to the same page without actually...
3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
1
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form. After the form has been submitted they are (redirected) onto...
2
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form.
0
by: Jesper Lauridsen | last post by:
I am developing an ASP.NET application for a Questionnaire that spans over several pages. The entire Questionnaire code resides in one ASPX page. When a user submits a questionnaire page by...
7
by: Tom wilson | last post by:
I have created a very simple example that doesn't work. Form1 contains a textbox and a button: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
8
by: TS | last post by:
Hi, i have inherited a page from another user. The page is the target frame in a frameset. for some reason the whole page runs twice (page_load, init, etc. all run twice) I can't figure out how...
2
by: Zubair.NET! | last post by:
Hi, I am working on somebody else's code built in ASP.NET/C#, during some of the request, ASP.NET Pages refreshes twice unexpectedly. My application runs in an IFrame with a LHS navigation...
4
by: Scott Shuster | last post by:
Hi, I've been searching and testing and have not yet found the answer I'm looking for. I have an ASP.NET (vb) application with an ecommerce function. When the user submits the page, I DON'T...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.