Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP page being executed twice...is it a bug? 3

Status
Not open for further replies.

vias

Programmer
Apr 25, 2000
54
GB
I am using an HTML form to post data to an Access database through IE browser, but when a user enters info into the database I am getting the info twice although the user only submits once.

It's not that the data is being written twice
but it looks like the the ASP page is being executed
twice. All the data is the same except the password field which is randomly generated in the ASP page. This shows that the page is twice executed.

I am thinking this is some sort of bug in IE or IIS.

Has anybody com across this problem?
 
it's probably your page! ;-)

are you using javascript &quot;form.submit()&quot; and allowing the <form> tag to submit too?

show us the page html

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Here is part of the code with the form name and the action.
In fact it is 'signup2.asp' which is being executed twice.

<form name=FormSignUp method=&quot;post&quot; action=&quot;signup2.asp&quot; onsubmit=&quot;return validate()&quot;>

<input type=hidden name=&quot;from&quot; value=&quot;<%=Request.Form
(&quot;from&quot;)%>&quot;>



If you need more code, I can post it.

Thanks in anticipation.
 
Your not submitting in your validate function, are you?
If so then you will be getting a double submit as jemminger mentioned above.

Is it possible your executing the insert statement to the database twice?

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Sorry I should explain that last comment, I was thinking along the lines of, if you had a function to handle the database insertion it might be possible that your calling it in two locations acidentally, I doubt this is the case, but thought it worth asking.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 

Jeff,

Here is the function:


function validate(){
if (isName() && isFullName() && emailCheck() && isBDate() && isCity() && isCountry()){
document.FormSignUp.submit();
}
else
return false;
}
 
function validate(){
if (isName() && isFullName() && emailCheck() && isBDate() && isCity() && isCountry()) {
document.FormSignUp.submit();
return true;
} else {
return false;
}
}

that's probably not it but this is the correct syntax


_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
now that I read the entire posts, your function is not correct. take out the submit() function as Tarwn states. This function is only for submiting the form dynamically form a button or href etc.. when not using the submit type.
so
function validate(){
if (isName() && isFullName() && emailCheck() && isBDate() && isCity() && isCountry()) {
document.FormSignUp.submit(); <--take it out
return true;
} else {
return false;
}
}

_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top