>hi,
>
>this is off-topic. i would like to know is there anyway to prevent the
>user from hitting the submit button more than once? because if the user
>clicks twice or more, one or more duplicated data will be sent to the
>servlets; and duplicated data will be written into the database as
>well....
>
>is there anyway to prevent this?
Yes, there is a way.... instead of using <input type=submit> use <input
type=button onlclick=check()>
where check is a javascript function ... use that function to allow only one
time on submitting.
JS file
var c=false;
function check()
{ if (c) alert('already submitted');
else
{c=true;
document.your_form_name.submit();
}
}
but of course this is not really that safe yet.. this is double submit
prevention (accidentally) ...
because user can just edit your code and allow submit twice...
jack
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html