- Posts: 227
- Thank you received: 36
Ask the community, share ideas, and connect with other LimeSurvey users!
var $emailBoxes = $('#answer559779X556X128541_a,#answer559779X556X128542_a'); var emailPat = /^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/ $('#movenextbtn').on('click',function(){ var errorState = false; $emailBoxes.each(function(){ var tempEmailInput = $.trim($(this).val()); if(tempEmailInput != '' && emailPat.test(tempEmailInput) == false){ //Input is not empty and Do not pass email validation test $(this).css('background-color','red'); $('span.questionhelp:first').text('Please enter valid email id').css('color','red'); errorState = true; } }); if(errorState){ return false; } });