0

this will not work on change. also the innerhtml wont display. please help. here is the js:

function checkemail(){
if (document.suform.email.value && document.suform.emailcheck.value)
{
if (document.suform.email.value == document.suform.emailcheck.value)
{
document.suform.emailcheck.style.backgroundColor='#FFFFFF';
document.getElementById('wm').innerHTML=='Emails Match!';
}else{
document.suform.emailcheck.style.backgroundColor='#F75B53';
document.getElementById('wm').innerHTML=='Emails Dont Match!';
}
}
}

and here is the html: Re-type Email: <input type='text' class='rfield' name='emailcheck' id='emailcheck' onchange='checkemail()'></td><td style='position: relative;'><div id='wm' style=' font-size: 11PX; position: relative;'></div>

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by sivakumarl
0

If innerHTML doesn't display, it may mean that your JavaScript has stopped working internally. What browser are you using? Is this the only script you have on the page? Only partial code of the page won't help...

0

Take a look at the code

function checkemail(){
if (document.suform.email.value && document.suform.emailcheck.value)
{
if (document.suform.email.value == document.suform.emailcheck.value)
{
document.suform.emailcheck.style.backgroundColor='#FFFFFF';
document.getElementById('wm').innerHTML=='Emails Match!';
}else{
document.suform.emailcheck.style.backgroundColor='#F75B53';
document.getElementById('wm').innerHTML=='Emails Dont Match!';
}
}
}

You have an 'is equal to' instead of an equal to (=). Make this change and you should be OK.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.