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
https://forums.phpfreaks.com/topic/182901-email-clear-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.