Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using jQuery plugin jStepper in my MVC app for restricting a text box to numeric values.


allowDecimals = false and

decimalSperator = "," are not working.

I have tried like this

<input type="text" id="txtnum">

$("[id$='txtnum']").jStepper({ allowDecimals: false,disableNonNumeric:true,minDecimals: 0, minValue: 1, maxValue: 99, minLength: 2 });

Except allowDecimals everything is working fine..

I have tried to create onStep function,even it is not working


$("[id$='txtnum']").jStepper({ onStep: allowdec });
function allowdec(objTextField,bDirection,bLimitReached) {
if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')
}

function allowdec(){alert("hai")} is also not working


Thanks for any help.
Posted

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