/$( "#users tbody" ).append...
and so on.
and it´s should be working. But it doesn´t, and I don´t get it why.$("form#modal-form").submit();
I do the modal windows with:
dialog = $( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Create User": addUser,
Cancel: function() {
dialog.dialog( "close" );
}
},
close: function() {
form[ 0 ].reset();
allFields.removeClass( "ui-state-error" );
}
});
And the addUser function:
function addUser() {
var valid = true;
allFields.removeClass( "ui-state-error" );
...validation of the form datas...
if ( valid ) {
//$( "#users tbody" ).append( "<tr>" +
// "<td>" + name.val() + "</td>" +
// "<td>" + email.val() + "</td>" +
// "<td>" + password.val() + "</td>" +
//"</tr>" );
$("form#modal-form").submit();
dialog.dialog( "close" );
}
return valid;
}
My form looks like this:
<form action="adduser.php" name="modal-form" id="modal-form" method="POST">
<fieldset>
<label for="name">Name</label>
<input type="text" name="name" id="name" value="Jane Smith" class="text ui-widget-content ui-corner-all">
<label for="email">Email</label>
<input type="text" name="email" id="email" value="jane@smith.com" class="text ui-widget-content ui-corner-all">
<label for="password">Password</label>
<input type="password" name="password" id="password" value="xxxxxxx" class="text ui-widget-content ui-corner-all">
</fieldset>
All I get is the error
Where is my mistake? Can anyone maybe help me?Too much recursion