Hello all,
I am stuck here with a problem. I want to check if someone enters a negative score on a multiple form page. I want that the edit field is red color if the score is negative.
I call htis function with the onblur event
input name="pickscorehome" type="text" class="pickedits" id="pickscorehome" onblur="checknumberhome(this.form);" onchange="Setradio(this.form);"
The problem is that there are an undefined number of forms on the page that are generated out of a database. How can i do that for each form ? Seems works only on
the first form.
Thanks for any hints.
Peter
function checknumbervisitor(f)
{
if(parseFloat(f.pickscorevisitor.value)<0)
{
alert("There are no negative scores. Please enter a positive number");
document.getElementById('pickscorevisitor').style.backgroundColor="#FF0000";
}
else
{
document.getElementById.getElementById('pickscorevisitor').style.backgroundColor="#FFFFFF";
}
}