[ 4 posts ]

Greg Hinch

YUI Contributor

  • Username: greghinch
  • Joined: Wed Jun 03, 2009 10:49 am
  • Posts: 73
  • Location: Fairfax, CA , USA
  • Twitter: greghinch
  • GitHub: ghinch
  • Gists: ghinch
  • IRC: gr-eg
  • Offline
  • Profile

Which validators built in?

Post Posted: Mon Nov 02, 2009 10:58 am
+0-
Please request any default validators, such as email addresses, you'd like to have available for use in the Form module.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Which validators built in?

Post Posted: Mon Nov 02, 2009 4:32 pm
+1-
Email Address
IP Address
Postal Code
Non-Special Characters
Telephone

How's that ;)

Viktor Rennert

YUI Contributor

  • Username: Blackshark
  • Joined: Wed Sep 09, 2009 5:18 am
  • Posts: 8
  • Location: Berlin
  • GitHub: vrennert
  • Gists: vrennert
  • IRC: Blackshark
  • Offline
  • Profile

Re: Which validators built in?

Post Posted: Mon Nov 02, 2009 5:57 pm
+0-
Can you make telephone and zip code validation based on regex patterns?
Because they are different from country to country.

nickweavers

  • Joined: Fri Jan 29, 2010 2:05 am
  • Posts: 62
  • Offline
  • Profile

Re: Which validators built in?

Post Posted: Thu Jul 05, 2012 3:06 am
+0-
Where can I find a list of builtIn validators that already exist?

If isNumber isn't already provided it would be nice to have, especially if it could deal with locale differences (France use the comma as the decimal period as well as for the thousands delimiter I believe).

The very simple check I have used is:

function validateNumericInput (val) {
if (!isNaN(parseFloat(val)) && isFinite(val) && (val > 0) && (val != '')) {
return true;
} else {
amount_to_borrow.set('error', 'Please enter a valid number > ');
return false;
}

}

But I'm finding that maybe a field event isn't triggered if a value isn't entered, so the val != '' is redundant.

How do I get Form to validate for "required" fields?

TIA,
Nick
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum