Email Address Field?
Email Address Field?
Can someone please tell me how to make a required field that will only accept a valid email address? Thanks!
Re: Email Address Field?
Sure. Go into AppGini and check off the the field must not be empty.
Then you need a entry checking routine.
Here is a routine to do this as javascript. This is a very basic one which can be built upon. It is found here:
http://www.w3schools.com/js/js_form_validation.asp
I have written my own based upon the above and it is a bit more complex but this is the basic construction you need.
Hope this helps a bit. You can then add in a routine to use the above code as the user moves to another field. (leaves the email address field)
Alan
Then you need a entry checking routine.
Here is a routine to do this as javascript. This is a very basic one which can be built upon. It is found here:
http://www.w3schools.com/js/js_form_validation.asp
Code: Select all
function validateForm()
{
var x=document.forms["myForm"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
}
Hope this helps a bit. You can then add in a routine to use the above code as the user moves to another field. (leaves the email address field)
Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -