View Full Version : email
Mister B.
08-26-03, 01:23 PM
how can I make a form, when submitted check if an email adress is in normal format or not?
Try this out:
http://www.xs4all.nl/~ppk/js/mailcheck.html
Mister B.
08-26-03, 06:39 PM
is there a way to make a function that runs other functions. for example, I have a form that I want to run two functions, when submitted.
<script language="JavaScript">
function main() {
stepOne();
stepTwo();
}
function stepOne() {
// do stuff
}
function stepTwo() {
// do stuff
}
</script>
Mister B.
08-26-03, 07:33 PM
thanks shane I will try that.
Mister B.
08-26-03, 07:48 PM
well I tried it that way, but because of the way the other function is set up, it dosent work, so here is my code, you hopefully can tell me why the return(false); dosent work
<HTML>
<HEAD><TITLE>Sign Up For Chaotic Evil</TITLE>
<script language="JavaScript">
function checkMail()
{
var x = document.forms[0].email.value;
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x))
return (true);
else
alert('NO! Incorrect email address');
return (false);
}
</Script>
</HEAD>
<BODY>
<script language="JavaScript">
function Checkalign(theform){
if ((theform.uname.value == "") || (theform.rname.value == "") || (theform.upass.value == "") || (theform.uemail.value == "") || (theform.uwebsite.value == "") || (theform.upass.value != theform.confpass.value)) {
alert("You must fill in all fields, and your passwords must match.");
return (false);
}
else{
return (true);
}
}
</Script>
<FORM name="formcheck" ACTION="/cubularrpg/Signupr.asp" Method="post" onSubmit="return Checkalign(this)">
<PRE>
Username: <INPUT TYPE="TEXT" Name="uname" ID=uname>
Realname: <INPUT TYPE="TEXT" Name="rname" ID=rname>
Password: <INPUT TYPE="password" Name="upass" ID=upass>
Confirm Pass: <INPUT TYPE="password" Name="confpass" ID=confpass>
Email: <INPUT TYPE="TEXT" Name="email" ID=uemail>
Website: <INPUT TYPE="TEXT" Name="uwebsite" ID=uwebsite>
MSN Account: <INPUT TYPE="TEXT" Name="msnacct" ID=msnacct>
ICQ Number: <INPUT TYPE="TEXT" Name="icqacct" ID=icqacct>
AOL Account: <INPUT TYPE="TEXT" Name="aolacct" ID=aolacct>
Yahoo Account: <INPUT TYPE="TEXT" Name="yhoacct" ID=yhoacct>
<INPUT TYPE="submit" Name="submit" Value="Submit" onClick="checkMail()">
</PRE>
</FORM>
</BODY>
</HTML>
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.