Создание модального окна Grail Jquery и публикация форм с помощью ajax?
У меня есть следующий код:
<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>
и мое модальное окно с использованием 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>
Приведенный выше код рисует мое модальное окно, но как я могу опубликовать форму в attachCommentController и получить ответы обратно, чтобы показать ошибки в модальном окне?