ColdFusion TIPS PLUS
Issue 00146 http://www.cftipsplus.com
I. My CommentsII. JavaScript - OnFocus
By Nathan Stanford
NathanS<AT>nsnd.com
I. Comments:
I am not sure when Nathan's Rules of Professional Web Design Part 2 will come. I have plenty to say but not sure when I will get the next part done. However Here is some Javascript that helped someone who asked me a question the other day.
Keep Coding,
Nathan Stanford
http://www.cftipsplus.com
If you have suggestions for articles send them to us.
If you would like to write for cftipsplus.com
send us an email to:
NathanS<at>nsnd.com
IF YOU WANT TO BE AN AUTHOR SEND IN YOUR COLDFUSION TIPS.
Remember this is a great way to get your name known in the
ColdFusion Community.
II. JavaScript - OnFocus
By Nathan Stanford
NathanS<AT>nsnd.com
Input Hours or Exempt Hours but NOT both. This code will make sure that happens.
2 Examples Below
<script language="JavaScript">
function Clr_txtHourly()
{
document.FormName.txtHourly.value = "";
}
function Clr_txtExempt()
{
document.FormName.txtExempt.value = "";
}
function Clr_txtHourly1()
{
document.FormName1.txtHourly1.value = "";
}
function Clr_txtExempt1()
{
document.FormName1.txtExempt1.value = "";
}
</script>
Example 1:
<form action="test1.cfm" name="FormName" method="post">
Hourly: <input type="text" name="txtHourly" onfocus="Clr_txtExempt();"><br>
Exempt: <input type="text" name="txtExempt" onfocus="Clr_txtHourly();"><br>
</form>
Example 2:
<form action="test1.cfm" name="FormName1" method="post">
Hourly: <input type="text" name="txtHourly1" ONKEYPRESS="if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;" onfocus="Clr_txtExempt1();"><br>
Exempt: <input type="text" name="txtExempt1" ONKEYPRESS="if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;" onfocus="Clr_txtHourly1();"><br>
</form>
Publisher and Creator:
Nathan Stanford,
NathanS<at>nsnd.com
http://www.cftipsplus.com
Macromedia and ColdFusion are U.S. registered trademarks.
Copyright (c) 2000 - 2004
CFTIPSPLUS.COM and NSND.COM
Permission is granted to circulate this publication via
MANUAL forwarding by email to friends provided that the text is
forwarded in its entirety and no fee is charged.