Hello this is my second attempt to solve this problem with JQuery
I need Check that a row of input must be minor than other one in the same row for a dinamic table of “n” rows, before send my form…I need check row by row using the input “ID” property…
Here my Code: http://jsfiddle.net/cespinoza/bQcu2/36/
<form >
Line 1 Get <input type="val1" name="text1" id="desp" /> from <input type="val1" name="text1" id="cantidad" /><br>
Line 2 Get <input type="val2" name="text2" id="desp" /> from <input type="val2" name="text2" id="cantidad" /><br>
Line 3 Get <input type="val3" name="text3" id="desp" /> from <input type="val3" name="text3" id="cantidad" /><br>
<button type="submit">Submit</button>
</form>
Edited: Added the Original JS code
$('#desp').change(function(){
if($('#desp').val() == $('#cantidad').val())
{
alert("First value is greater than second, sorry")
return False;
}
else
{
alert("All ok, push to database")
return True,
}
});
Thanks in Advance.
Christian.
I Finally was able to solve this problem, thanks anyway…
This was the solution: