If I fill out the textfields properly with Name, Email etc in a row it
is fine. But if I fill out, for example, my Name, then tab twice, it
clears my entered value. How do I stop this?
All I want the script to do is that when the cell is blank or
whitespace, put the necessary text in the field, else, continue as
normal.
--- HTML Extract
<td width="74%">
<input name="name" type="text" class="textbox" id="name"
onMouseOver="th is.style.backgr oundColor = 'CDEDDD';"
onMouseOut="thi s.style.backgro undColor = 'E2E2E2';"
onfocus="this.s tyle.background Color = 'CDEDDD'; this.style.colo r =
'000000';textua l(name,this.val ue);"
onblur="this.st yle.backgroundC olor = 'E2E2E2'; this.style.colo r =
'000000';textua l(name,this.val ue);"
value="Enter Name" size="30"></td></tr>
-- END Extract
function textual(element ,text) {
var name,company,em ail,worknumber, homenumber,quer y
// If the Field contains the default text, clear it ready for new text
if (text=="Enter Name") { document.form1. name.value = "" }
if (text=="Enter Company Name") { document.form1. company.value = "" }
if (text=="Enter Email Address") { document.form1. email.value = "" }
if (text=="Enter Work Number") { document.form1. worknumber.valu e = ""
}
if (text=="Enter Home Number") { document.form1. homenumber.valu e = ""
}
if (text=="Enter your query here...") { document.form1. query.value =
"" }
// If the Field is blank, re-write the contents
if (text=="") {
if (element="name" ) { document.form1. name.value = "Enter Name" }
if (element="compa ny") { document.form1. company.value = "Enter
Company Name" }
if (element="email ") { document.form1. email.value = "Enter Email
Address" }
if (element="workn umber") { document.form1. worknumber.valu e = "Enter
Work Number" }
if (element="homen umber") { document.form1. homenumber.valu e = "Enter
Home Number" }
if (element="query ") { document.form1. query.value = "Enter your query
here..." }
}
}
is fine. But if I fill out, for example, my Name, then tab twice, it
clears my entered value. How do I stop this?
All I want the script to do is that when the cell is blank or
whitespace, put the necessary text in the field, else, continue as
normal.
--- HTML Extract
<td width="74%">
<input name="name" type="text" class="textbox" id="name"
onMouseOver="th is.style.backgr oundColor = 'CDEDDD';"
onMouseOut="thi s.style.backgro undColor = 'E2E2E2';"
onfocus="this.s tyle.background Color = 'CDEDDD'; this.style.colo r =
'000000';textua l(name,this.val ue);"
onblur="this.st yle.backgroundC olor = 'E2E2E2'; this.style.colo r =
'000000';textua l(name,this.val ue);"
value="Enter Name" size="30"></td></tr>
-- END Extract
function textual(element ,text) {
var name,company,em ail,worknumber, homenumber,quer y
// If the Field contains the default text, clear it ready for new text
if (text=="Enter Name") { document.form1. name.value = "" }
if (text=="Enter Company Name") { document.form1. company.value = "" }
if (text=="Enter Email Address") { document.form1. email.value = "" }
if (text=="Enter Work Number") { document.form1. worknumber.valu e = ""
}
if (text=="Enter Home Number") { document.form1. homenumber.valu e = ""
}
if (text=="Enter your query here...") { document.form1. query.value =
"" }
// If the Field is blank, re-write the contents
if (text=="") {
if (element="name" ) { document.form1. name.value = "Enter Name" }
if (element="compa ny") { document.form1. company.value = "Enter
Company Name" }
if (element="email ") { document.form1. email.value = "Enter Email
Address" }
if (element="workn umber") { document.form1. worknumber.valu e = "Enter
Work Number" }
if (element="homen umber") { document.form1. homenumber.valu e = "Enter
Home Number" }
if (element="query ") { document.form1. query.value = "Enter your query
here..." }
}
}
Comment