I have a page shown below that displays a list of user records from a database with a button. When I clicked on that button display a jquery modal form with a form that allows someone to enter their user information.
My problem is when I click on the 'Add New User' button on the modal form the data should be insert to the database. But that data is not going to database.
This is the code in users.php page with modal form dialog
<body>
<h1>User Management System</h1>
<div id="manage_user">
<form action="" method="">
// Here I display a table with user details.................
<button id="FormSubmit">Add New User</button>
</form>
</div>
<div id="dialog" class="new_user_dialog_box" title="Add New User">
<p>Fill this form with your details and click on 'Add New User' button to register.</p>
<p class="validateTips">All form fields are required.</p>
<div id="new_user_form">
<table>
<tr>
<td>Name :</td>
<td><input type="text" name="name" value="" id="name" /></td>
</tr>
<tr>
<td>Address :</td>
<td><input type="text" name="address" value="" id="address" /></td>
</tr>
<tr>
<td>City :</td>
<td><input type="text" name="city" value="" id="city" /></td>
</tr>
</table>
</div>
</div>
</body>
The Javascript/jQuery script is
if ( bValid) {
jQuery.ajax({
type: "POST", // HTTP method POST or GET
url: "process.php", //Where to make Ajax calls
dataType:"text", // Data type, HTML, json etc.
data:bValid, //Form variables
success:function(response){
//on success, hide element user wants to delete.
//$('#item_'+DbNumberID).fadeOut("slow");
},
error:function (xhr, ajaxOptions, thrownError){
//On error, we alert user
alert(thrownError);
}
});
$(this).dialog("close");
}
Any help here is much appreciated.
Thank you.
Allmenu on firebug there is a tab calledresponseand there is a message like thiserror in post array