Pregunta

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?

¿Fue útil?

Solución

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>

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top