Auto select text in an edit field
Heres what I have for code the rest works except fot the first line and I'm not sure what I am missing?
function emailJSFocus($sender, $params)
{
?>
document.Vendor('email').select();
findObj('email').style.backgroundColor= '#fdfbd9';
<?php
}
function emailJSBlur($sender, $params)
{
?>
if (document.getElementById("email").value == "") {
findObj('email').style.backgroundColor= '#ffcaca';
document.getElementById("email").value = "Required!"
}
if (document.getElementById("email").value.indexOf ('@', 0) == -1) {
findObj('email').style.backgroundColor= '#ffcaca';
document.getElementById("email").value = "Not valid!"
}
else {
findObj('email').style.backgroundColor= '#d0ffca';
}
|