Link to home
Start Free TrialLog in
Avatar of Robb Hill
Robb HillFlag for United States of America

asked on

jquery validate number

I am creating the following html field on the fly in c# code....and trying to validate if its a number or not.
 contact.allocation = @"<input type='number'   onblur='validateDecimal(this);'  pattern='\d + '   step='0.01' value='" + contact.allocationValue + "' placeholder='0.00'  id='txtAllocation_" + contact.clientxcontactId + @"'>%</input>";

Open in new window

When I leave the input box the validateDecimal is always telling me to please return a valid number....even if I just put a value like 6 or 6.00

Here is the validate function:
function validateDecimal(value) {
    if (!($.isNumeric(value)))
        Conarc.UI.Messenging.getErrorPopup("Please enter a numeric value for Allocation");
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robb Hill

ASKER

Thank you!   Sorry it took so long to respond.
You are welcome.