Auto email validation

Ok this provides me with password with auto validation:


Does this not provide autovalidation for email:

Inner html placed within a rectangle.

Here’s more info on the ‘types’

Not sure what your question is?

Hi Daniel,

I understand that to avoid sql injection my inputs should validate what the user inputs. If I was to create a form email input then it would of course not allow me to put any thing else in. The code shown for the password above works fine, but the email input within the div doesn’t do anything, how do I get it to validate the input?

I did something like this for a Hype 3.5 teaser: (1.1 MB)

I used:

It looks at an email input field and shows an error if it’s not a correct email:

var myLanguage = {
	    requiredFields: 'Please fill in all fields.',
	    badEmail: 'Double check your address please!'
	    validateOnBlur: true,
	    language: myLanguage
	  $('emailfield').bind('beforeValidation', function() {
	    //$('button[type=submit]').attr('disabled', 'disabled');
	    document.getElementById("submit").disabled = true;
	  }).bind('validation', function(evt, isValid) {
	    document.getElementById("submit").disabled = false;
	    var form = document.getElementById("main-mailing-list");
	    document.getElementById("submit").addEventListener("click", function() {
	      document.getElementById("thanks").innerHTML = "Got it, Thanks! We'll let you know."
1 Like

That looks fantastic thanks Daniel. :slight_smile: