Hi folks,
I need a script which shows up alert after the validation.
I'm trying to use [$repeatCounter] with jQuery for the validation of repeat tables however
it dosn't work. (Is this placeholder for only php?)
Notes: [$repeatCounter] in jQuery code should be the same number when the validation occurs.
=======================================
Additional Information:
I also tried to use php validation instead of jQuery but the alert didn't show up.
Please let me know if anyone has any solution.
Thank you in advance.
I need a script which shows up alert after the validation.
I'm trying to use [$repeatCounter] with jQuery for the validation of repeat tables however
it dosn't work. (Is this placeholder for only php?)
Code:
$("[id^=join___5___form_10_repeat___valtwo]").on("blur", function() {
var valone = $('#join___5___form_10_repeat___valone_[$repeatCounter]').val();
var valtwo = $('#join___5___form_10_repeat___valtwo_[$repeatCounter]').val();
if( valone < valtwo ) {
alert("Error msg");
}
});
Notes: [$repeatCounter] in jQuery code should be the same number when the validation occurs.
=======================================
Additional Information:
I also tried to use php validation instead of jQuery but the alert didn't show up.
PHP:
$one= $formModel->getElementData('form_10_repeat___valone', true, 0);
$two = $formModel->getElementData('form_10_repeat___valtwo', true, 0);
if(isset($one)&&isset($two)) {
echo ($one[$repeatCounter] < $two [$repeatCounter]) ? '<script>alert("It's wrong!")</script>': 'Its fine!';
}
Please let me know if anyone has any solution.
Thank you in advance.