After checking the check box, i have to check the Entered values in the form , so i have to pass all the params from the form to the controller, if the values are not equal, it has to raise an alert,is there any simple way to do that?

有帮助吗?

解决方案

Do you want to do the validation on the front-end? or back-end?

To raise an alert from the back end just simply do your comparison with the params and if there is an issue, add this :

flash.message = "What ever your error is"
flash.alertType = "danger"

and then in the GSP

<g:if test="${flash.message}">
<div class="alert<g:if test="${flash.alertType}"> alert-${flash.alertType}</g:if> fade in">
    <button class="close" data-dismiss="alert">×</button>
    ${flash.message}
</div>

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top