replied on March 25, 2015
Hello,
I am creating some fields (HTML Elements ) dynamically in the page that need to be validated , .I know if the field can't pass the validation, A "ws-invalid" should be added to the parent DIV and also a 'user-error' class should be added to that filed .
So , I need to modify the java script code when the page is submitted . Here is my code :
$('#form1').on('submit', function (event) {
HoursDayValidation();
if ($('li[attr=PracticeLocationLI_Time] .user-error').length > 0 && $('.ws-invalid').length == 0) return false; *(A)
})
But when I return "False"(A) , LF keeps submitting the page and does prevent form from being submitted .
And also I tried to use event.preventDefault() instead of return "False" but still the form is being submitted .
How can i prevent form from being submitted ?
Regards,
Reza.