Validatie van velden (bijv check op nummers in telefoon) REGEX

Regex functies in Jquery 

Eenmalige include in template of one page template

 

<script>
var $j = jQuery.noConflict();
jQuery(function($){
window.addEvent('domready', function(){
document.formvalidator.setHandler('letters', function(value) {
regex=/^[a-zA-Z\s]*$/;
return regex.test(value);
});
});
})

var $j = jQuery.noConflict();
jQuery(function($){
window.addEvent('domready', function(){
document.formvalidator.setHandler('adres', function(value) {
regex=/^[^!]+$/;
return regex.test(value);
});
});
})

var $j = jQuery.noConflict();
jQuery(function($){
window.addEvent('domready', function(){
document.formvalidator.setHandler('postcode', function(value) {
regex=/^[^!][a-zA-Z\s\d]*$/;
return regex.test(value);
});
});
})

 

 

</script>
<script>

jQuery(function($){$( "#hnr_field" ).addClass( "validate-numeric" );})
jQuery(function($){$( "#last_name_field" ).addClass( "validate-letters" );})
jQuery(function($){$( "#first_name_field" ).addClass( "validate-letters" );})
jQuery(function($){$( "#company_field" ).addClass( "validate-letters" );})
jQuery(function($){$( "#address_1_field" ).addClass( "validate-adres" );})
jQuery(function($){$( "#city_field" ).addClass( "validate-adres" );})
jQuery(function($){$( "#zip_field" ).addClass( "validate-postcode" );})
</script>

Hebt u meer vragen? Een aanvraag indienen

Opmerkingen

Mogelijk gemaakt door Zendesk