Jump to content

email clear problem


chriscloyd

Recommended Posts

Well I have this script and the name one is working but the email one isnt working :(  can someone help me

 

window.onload = initpage;

function initpage () {
        document.getElementById("name").onblur = checkname;
document.getElementById("nlemail").onblur = checknlemail;
}
function checkname() {
var name = document.getElementById("name").value;
if (name == '') {
	document.getElementById("name_hidden").innerHTML = 'Please enter your name.';
} 
else {
	document.getElementById("name_hidden").innerHTML = '';
}
}
function checknlemail() {
var email = document.getElementById("nlemail").value;
document.getElementById("email_hidden").innerHTML = 'TEST';
}

 

that was my ajax now my html

is

<form id="newsletter" name="newsletter" method="post" action="">
  <input name="nlemail" type="text" id="nlemail" value="Email" />
  <div id="email_hidden"></div>
  <input name="name" type="text" id="name" />
  <div id="name_hidden"></div>
</form>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.