Try this:

$(function(){
 $('#DNnumber').keyup(function(){
   if (parseInt($(this).val()) > 40) {
     $('#external').attr("checked", "checked");
     $('#internal').attr("checked", "");
   } else {
     $('#external').attr("checked", "");
     $('#internal').attr("checked", "checked");
   }
 });
});


on 25/05/2009 13:51 ciupaz said::
Hi all,
I have two checkboxes like these ones:

<span>
    <input name="place" id="internal" type="checkbox"
value="internal" />Internal (up to DN 40)<br />
    <input name="place" id="external" type="checkbox"
value="external" />External (over DN 40)
</span>

and a textbox like this:

Insert the DN number:
<input name="DNnumber" id="DNnumber" type="text" />

I'd like a sort of validation that when the user insert a DN number
greater than 40, the checkbox "external" will be automatically
selected (without change it).

How can I accomplish this?

Thanks a lot.

Luigi

Reply via email to