¿Creando una ventana modal y una forma de Grail Jquery con ajax?
Tengo el siguiente código :
<body>
<div id="dialog-form" title="Create a new Comment">
<form>
<fieldset>
<label for="name">Enter your Comment Please </label>
<textarea rows="6" cols="2" name="commentArea" id="commentArea" ></textarea>
</fieldset>
</form>
</div>
<button id="create-user">Create new user</button>
</body>
y mi ventana modal usando jquery-UI
<g:javascript>
$(function(){
$("#dialog-form").dialog ({
autoOpen:false,
height:300,
resizable:false,
width:350,
modal:true,
buttons: {
"Attach Comment": function() {
alert('assum it already submitted'); // ? ? ? this time what can i add to post a form to a controller attachComments with commentArea posted.
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
},
close: function() {
alert(Form is cloased!);
$(this).dialog("close");
}
});
$( "#create-user" )
.button()
.click(function() {
$( "#dialog-form" ).dialog( "open" );
});
});
</g:javascript>
El código anterior dibuja mi ventana modal pero, ¿cómo puedo publicar el formulario para adjuntarCommentController y recibir respuestas para mostrar errores en la ventana modal?