Was wanting to know how to check using jquery if a input contains a number higher then 99
Simply use this:
if ($("input.INPUTNAME").val() > 99) {
//above 99 code
}
You may want to have an else command, if the input is below 99.
if ($("input.INPUTNAME").val() > 99) {
//above 99 code.
}
else{
//Not above 99 code.
}
if(parseInt($(YOURINPUT).val()) > 99) // do something
This would do it
var value = $("input selector").eq(0).val();
if(isNaN(value)){
//do stuff
}
else{
var num = value - 0;
if(num>99)
{
//value is greater than 99
}
}
I guess typically with jQuery you would have to have the name of the form
<form id="myForm" action="comment.php" method="post">
number: <input id="form_number" type="text" name="number" />
Comment: <textarea name="comment"></textarea>
<input type="submit" value="Submit Comment" />
</form>
you would select the form and its input.
var myInt = parseInt(jQuery("#form-number-url").attr("value"));
then you can compare it with any other integer.
Use this:
html:
<input type="text" id="myInput" />
jquery:
var nMyInput = $("#myInput").val();
if (typeof nMyInput != "undefined"){
if(!isNaN(nMyInput)){
if (parseInt(nMyInput) > 99) {
/* do your stuff */
}
}
}
If by input you mean text, then use the following:
if (parseFloat($("#inputid").val()) > 99) {
//do something
}