[jQuery] Input background color change
in Using jQuery
•
16 years ago
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Input background color change</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">I have a function where if I *need* to I pop a validation error window. I set the focus to the offending fld first.</FONT>
<BR><FONT SIZE=2 FACE="Arial">I want to also make the background color of the offending field RED for example too.</FONT>
<BR><FONT SIZE=2 FACE="Arial">1. Sorry if this is doable in JS and I did not know it..</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">2. If I can do it with JQuery can I get an example of how to do so?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Sincerely,</FONT>
<BR><FONT SIZE=2 FACE="Arial">dan</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">function makeMoney( fld )</FONT>
<BR><FONT SIZE=2 FACE="Arial">{</FONT>
<BR><FONT SIZE=2 FACE="Arial"> var num = fld.value.replace( numberOnly, "" );</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if ( ! validNum.test( num ) )</FONT>
<BR><FONT SIZE=2 FACE="Arial"> {</FONT>
<BR> <FONT SIZE=2 FACE="Arial">fld.focus( );</FONT>
<BR> <FONT SIZE=2 FACE="Arial">var popHelp = window.open("/SBDX/Scripts/popHelp.asp?ID=" + fld.name + "&err=validation", "popErr", "resizable=1,height=300,width=400")</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">popHelp.focus();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">return fld.value; // or return blank or or or</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial">// ...</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<FONT SIZE=3><BR>
<BR>
*************************************************************************<BR>
This communication, including attachments, is<BR>
for the exclusive use of addressee and may contain proprietary,<BR>
confidential and/or privileged information. If you are not the intended<BR>
recipient, any use, copying, disclosure, dissemination or distribution is<BR>
strictly prohibited. If you are not the intended recipient, please notify<BR>
the sender immediately by return e-mail, delete this communication and<BR>
destroy all copies.<BR>
*************************************************************************<BR>
</FONT>
</BODY>
</HTML>_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Input background color change</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">I have a function where if I *need* to I pop a validation error window. I set the focus to the offending fld first.</FONT>
<BR><FONT SIZE=2 FACE="Arial">I want to also make the background color of the offending field RED for example too.</FONT>
<BR><FONT SIZE=2 FACE="Arial">1. Sorry if this is doable in JS and I did not know it..</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">2. If I can do it with JQuery can I get an example of how to do so?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Sincerely,</FONT>
<BR><FONT SIZE=2 FACE="Arial">dan</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">function makeMoney( fld )</FONT>
<BR><FONT SIZE=2 FACE="Arial">{</FONT>
<BR><FONT SIZE=2 FACE="Arial"> var num = fld.value.replace( numberOnly, "" );</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if ( ! validNum.test( num ) )</FONT>
<BR><FONT SIZE=2 FACE="Arial"> {</FONT>
<BR> <FONT SIZE=2 FACE="Arial">fld.focus( );</FONT>
<BR> <FONT SIZE=2 FACE="Arial">var popHelp = window.open("/SBDX/Scripts/popHelp.asp?ID=" + fld.name + "&err=validation", "popErr", "resizable=1,height=300,width=400")</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">popHelp.focus();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">return fld.value; // or return blank or or or</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial">// ...</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<FONT SIZE=3><BR>
<BR>
*************************************************************************<BR>
This communication, including attachments, is<BR>
for the exclusive use of addressee and may contain proprietary,<BR>
confidential and/or privileged information. If you are not the intended<BR>
recipient, any use, copying, disclosure, dissemination or distribution is<BR>
strictly prohibited. If you are not the intended recipient, please notify<BR>
the sender immediately by return e-mail, delete this communication and<BR>
destroy all copies.<BR>
*************************************************************************<BR>
</FONT>
</BODY>
</HTML>_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/