numeric only validation & mouseover

liunx

Guest
Hi All,<br />
I am trying to ensure that only numeric fields are entered into a text field. Can someone help me out. Here is the code:<br />
<br />
if (frmUser.CreditCard.value == "") {<br />
alert("You must enter a numeric Credit Card number");<br />
form.CreditCard.focus()<br />
return false; }<br />
<br />
<br />
I am also having trouble with the mouseover (Aqua color) effect with this:<br />
<A HREF = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"chestnut1.asp?prod=Golf Clubs">Golf Clubs</A><br />
<br />
I tried the ALink and VLink. All I want is the text color to change Aqua when the mouse is over it and then it's normal color when the mouse is not on it. I tried a few things but it wouldn't work.<br />
<br />
Thanks all!!<!--content-->1)<br />
<br />
There is an object in Javascript called Number.<br />
You can use it like this:<br />
<br />
var inp = Number(frMUser.CreditCard.value);<br />
if (!inp){<br />
alert("You must enter a numeric Credit Card number");<br />
form.CreditCard.focus()<br />
return false; <br />
}<br />
<br />
2)<br />
I suggest you give your link a className:<br />
<A class="aqua" HREF = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"chestnut1.asp?prod=Golf Clubs">Golf Clubs</A><br />
<br />
And then set up a style sheet in the HEAD of your document:<br />
<head><br />
<style><br />
A.aqua: link,visited { color: white; text-decoration: none; }<br />
A.aqua: hoover {color: aqua; text-decoration: underline; }<br />
A.aqua: active {color: red; text-decoration: underline; }<br />
</style><br />
</head><!--content-->
 
Back
Top