gibsonguy
Technical User
- Jul 9, 2012
- 2
Hi everyone (first post here)
I'm looking for a way to force the user to validate their email address and when this works give them access to send in user comments /questions etc. I have the two separate pieces of code both working but need a way to join them. Just to clarify, the user comment section should remain non-accessible until the user has run the email validation part.
Appreciate all replies!
Email Validation Code
-----------
*/
function evalform(address)
{ crucial = address.indexOf ("@");
if(crucial == -1)
{ window.alert("The E-mail address you entered is not a valid E-mail address.");
return false }
else
{ message = "You entered "+address+" -- Is this correct?";
return window.confirm(message)};
}
</SCRIPT>
</HEAD>
<BODY>
<FORM onSubmit="evalform(this.email.value)">
E-mail:
<INPUT NAME="email" TYPE="text" ROWS=1 SIZE="20">
<INPUT NAME="Submit" TYPE="Submit">
<INPUT NAME="Reset" TYPE="Reset">
Question/Comment Code
----------------------------
<h1><font color="white">Thanks for visiting our website</font></h1>
<h2><font color="white">Please fill in the attached form to register with us or to simply send any questions or comments</h2>
<SCRIPT LANGUAGE="javascript">
function verify()
{
var OpenWindow=window.open("", "newwin", "height=300,width=300");
OpenWindow.document.write("<HTML>")
OpenWindow.document.write("<TITLE>Thanks for Writing</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR='ffffcc'>")
OpenWindow.document.write("<CENTER>")
OpenWindow.document.write("Thank you <B>" + name + "</B> from <B>" +email+ "</B><P>")
OpenWindow.document.write("Your message <P><I>" + document.gbookForm.maintext.value + "</I><P>")
OpenWindow.document.write("from " + name + " / " +email+ "<P>")
OpenWindow.document.write("will be sent along when you close this window.<p>")
OpenWindow.document.write("<CENTER>")
OpenWindow.document.write("<FORM><INPUT TYPE='button' VALUE='Close Window' onClick='self.close()'></FORM>")
OpenWindow.document.write("</CENTER>")
OpenWindow.document.write("</HTML>")
}
</script>
<SCRIPT LANGUAGE='javascript'>
document.write("<FORM METHOD='post' ACTION='mailto:jburns@htmlgoodies.com?Subject=Mail from " +name+ " at " +email+ "' ENCTYPE='text/plain' NAME='gbookForm'>")
</SCRIPT>
<b>What would you like to tell me?<BR></b>
<TEXTAREA COLS="40" ROWS="20" NAME="maintext"></TEXTAREA><P>
<INPUT TYPE="submit" VALUE="Send It" onClick="verify()">
</FORM>
I'm looking for a way to force the user to validate their email address and when this works give them access to send in user comments /questions etc. I have the two separate pieces of code both working but need a way to join them. Just to clarify, the user comment section should remain non-accessible until the user has run the email validation part.
Appreciate all replies!
Email Validation Code
-----------
*/
function evalform(address)
{ crucial = address.indexOf ("@");
if(crucial == -1)
{ window.alert("The E-mail address you entered is not a valid E-mail address.");
return false }
else
{ message = "You entered "+address+" -- Is this correct?";
return window.confirm(message)};
}
</SCRIPT>
</HEAD>
<BODY>
<FORM onSubmit="evalform(this.email.value)">
E-mail:
<INPUT NAME="email" TYPE="text" ROWS=1 SIZE="20">
<INPUT NAME="Submit" TYPE="Submit">
<INPUT NAME="Reset" TYPE="Reset">
Question/Comment Code
----------------------------
<h1><font color="white">Thanks for visiting our website</font></h1>
<h2><font color="white">Please fill in the attached form to register with us or to simply send any questions or comments</h2>
<SCRIPT LANGUAGE="javascript">
function verify()
{
var OpenWindow=window.open("", "newwin", "height=300,width=300");
OpenWindow.document.write("<HTML>")
OpenWindow.document.write("<TITLE>Thanks for Writing</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR='ffffcc'>")
OpenWindow.document.write("<CENTER>")
OpenWindow.document.write("Thank you <B>" + name + "</B> from <B>" +email+ "</B><P>")
OpenWindow.document.write("Your message <P><I>" + document.gbookForm.maintext.value + "</I><P>")
OpenWindow.document.write("from " + name + " / " +email+ "<P>")
OpenWindow.document.write("will be sent along when you close this window.<p>")
OpenWindow.document.write("<CENTER>")
OpenWindow.document.write("<FORM><INPUT TYPE='button' VALUE='Close Window' onClick='self.close()'></FORM>")
OpenWindow.document.write("</CENTER>")
OpenWindow.document.write("</HTML>")
}
</script>
<SCRIPT LANGUAGE='javascript'>
document.write("<FORM METHOD='post' ACTION='mailto:jburns@htmlgoodies.com?Subject=Mail from " +name+ " at " +email+ "' ENCTYPE='text/plain' NAME='gbookForm'>")
</SCRIPT>
<b>What would you like to tell me?<BR></b>
<TEXTAREA COLS="40" ROWS="20" NAME="maintext"></TEXTAREA><P>
<INPUT TYPE="submit" VALUE="Send It" onClick="verify()">
</FORM>