button- can click more than once and data is getting inserted into the database repeatedly

T

Thomas Weidenfeller

vidya said:
In the javascript, i intoduced a new variable "submitted" with initial
value as 0. Now, Inside the if loop,
if (submitted == 0)
change submitted = 1,
do all the feild validations,
submit the form

if(submitted ==1)
give an alert telling that its already being submitted.

Thatz it!!

No, it is not. Many people have turned JavaScript off for security
reasons, so it will fail for them. You can't solve this at the client
side. You need to handle it on the server side.

/Thomas
 
A

Andrew Thompson

Thanks for ur help Mr. Thompson.

I have got the answer.

No you haven't..
Its really simple..

It looks really simple, doesn't it?
In the javascript, ...

BWAAAP! (That's the 'failed' klaxon..)

Have you even been listening? Post an example page that
connects to a dummy database (whatever) and we will
demonstrate how long (or short) it takes to corrupt.
 
T

The alchemist

try this
document.form1.submit.disabled = true;

mail me on (e-mail address removed), if it does not work.
otherwise a thanks will do ;-)
 
A

alchemist

sorry, been busy for a few days.
then i do believe the second solution that i gave in my first post is
the best in current scenario.
If you use that method, and hadle it carefully, it should work out.

post it if anybody as any queries on that.
 

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,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top