Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for example : I have a label where amount is 20000


now whenever i will try to enter more than that amount(i.e 20000) from account
then it should not accept my amount which i will enter(i.e 20001+).
Posted

1 solution

Add the following attribute on your validated control

onblur="javascript: return validateAmount();"

somewhere on the page add the following:

function validateAmount() {
var lbl = document.getElementById("yourlabelID");
if (lbl != null) {
if (lbl.value > 20000) {
alert("You may not enter the amount above 20000!");
return false;
}
}

return true;
}


if you use jQuery you can replace getElementById with $("#yourlabelID") and lbl.value with lbl.val()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900