PDA

View Full Version : *********** Help ***********


morpheause
08-14-2002, 04:01 PM
==============================================
<head>
<script language="JavaScript" src="check.js">
</script>
<title>Untitled Document</title>
</head>

<body bgcolor="#009900">
<form action='mailto:You@Yourdomain.com?subject=Testing' enctype="text/plain" method="post" name="stodelclub" id="stodelclub" onSubmit="return validateForm(this)" onFocusOut="clearStyle(event.srcElement);">

==============================================

I have got an Registration Form with validation.
After clicking on submit, I would like the Submit & Reset button to be disabled or I would like after clicking on submit that it redirects to another page.

I need an copy to be emailed to me.
That is why I am using the "mailto" function.

:D

Skyzyx
08-14-2002, 04:12 PM
Here's a script for what it sounds like you want to do.


function zSubmitOnce(submitform)
{
for (i=0; i<submitform.length; i++)
{
var temp=submitform.elements[ i ]; // No spaces between the brackets and the "i"
if(temp.type.toLowerCase()=="submit"||temp.type.toLowerCase()=="reset")
{
temp.disabled=true
}
}
}


You will need to replace submitform with document.formname for it to work. You'll also need to add it to your FORM tag for onSubmit.


<FORM name="boogers" onSubmit="zSubmitOnce(document.boogers);">


I think I ran across a similar script at DynamicDrive.com a few years ago that might have a little more explanation.

Hope this helps!

beetle
08-14-2002, 04:34 PM
Shame shame! :D You are using my validation script, and it has the built in functionality to disable the submit button!

onSubmit="return validateForm(this,0,1)"

I have a new version out that lets you disable the RESET button too (validateForm(this,0,1,1)) Contact me and I'll send it to you.

Email me if you have more questions. My email address is in the documentation that came with the script.

morpheause
08-15-2002, 08:13 AM
Thanks Beetle,

It works great.