Author:
erics , October 21st, 2012
$ valid = validateEmailAddress ( 'yourName@yourDomain.com' ) ;
function validateEmailAddress ( $ email = '' ) {
// returns 1 for valid and 0 for invalid
return ( int ) ( filter_var ( $ email , FILTER_VALIDATE_EMAIL ) && preg_match ( '/@.+\./' , $ email ) ) ;
}
Categories: How-To's , Technology Tags: Email , FILTER_VALIDATE_EMAIL , filter_var , php , preg_match , Valid , Validate
| No comments
Author:
erics , January 19th, 2012
public function valid ( $ function = '' ) {
$ methodVariable = array ( $ this , $ function ) ;
if ( is_callable ( $ methodVariable ) ) {
return $ this -> { $ function } ( ) ;
} else {
$ this -> msgs [ ] = "Validation method $function is unavailable!" ;
return 0 ;
}
}
Categories: How-To's , Technology Tags: Dynamic functions , Function , howto , php , tips , Valid , Validation , Variable , Variable function
| No comments
Author:
erics , October 19th, 2011
The ability to validate BEFORE a form is submitted greatly reduces end-user frustration by telling the user immediately what the issue is. The jQuery Validation plugin does just that. Here is a link to the plugin’s home page: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ This is a simple recipe for doing custom password validation: In the html head
<script src = "/js/jquery-1.6.2.min.js" > </script>
<script src = "/js/jquery.validate.min.js" > </script>
<script src = "/js/validate.js" > </script>
In […]
Categories: How-To's , Technology Tags: addMethod , howto , input , javascript , JQuery , jQuery.validate , jQuery.validator , JS , Password , Rule , Rules , tips , Valid , Validate , Validation
| 3 comments