Thank you I resolved my issue..
On Aug 10, 2:47 pm, Eduardo Pinzon wrote:
> jQuery.validator.addMethod("notNumber", function(value, element, param) {
> var reg = /[0-9]/;
> if(reg.test(value)){
> return false;
>
jQuery.validator.addMethod("notNumber", function(value, element, param) {
var reg = /[0-9]/;
if(reg.test(value)){
return false;
}else{
return true;
What I really wanted to do is use the jQuery validator and in the
function set a validation that numbers are not allowed in a text
input.
For example I have this code:
$(document).ready(function() {
// validate signup form on keyup and submit
var validator = $("#signupform").valid
I'm not that good with javascript.
If the textboxt name is txtname, how do you incorporate it in the code
above???
Hi KeeganWatkins,
Here is what the OP (nouky) wrote:
I would like to validate a textbox that numbers cannot be entered
into the text input
That sounds to me like he doesn't want any numbers to be allowed
anywhere within the value.
I'm interested to hear why you think /[^\d]/g is more ele
With all due respect, I think karl's solution is somewhat less than
elegant, and could be improved by refactoring to:
// test for anything but numbers
var isValid = /[^\d]/g.test(textareaValString);
if (isValid) {
// proceed with confidence
} else {
// note to user: no numbers allowed!
}
On Aug 7, 2009, at 2:53 PM, Michael Lawson wrote:
yes, you can grab the value of the textbox and match it against a
regular expression
var reg = new RegExp("/[a-zA-Z]/");
if(reg.test("string"))
{
return "valid";
}
else
{
return "not valid";
}
Hey Michael,
I don't think that regular express
yes, you can grab the value of the textbox and match it against a regular
expression
var reg = new RegExp("/[a-zA-Z]/");
if(reg.test("string"))
{
return "valid";
}
else
{
return "not valid";
}
like that
cheers
Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone: 1-276-206-8393
E-
8 matches
Mail list logo