I've a home.jsp (displays data in tabular form) inside a form which opens a pop up window to update data (editUser.jsp).
<form method ="post" action="editUser.jsp" onsubmit="target_popup(this)">
editUser.jsp has a form to update data
<form method="post" action="edit.jsp">
/*HTML FORM*/
after clicking on submit button it goes to edit.jsp page to update data to the database. In the edit.jsp page contains only java code for updating data and nothing else.
Now i've to auto refresh home.jsp page after the data is inserted to database or when the submit button is pressed in editUser.jsp? How can I do it?? Till now I've to manually refresh the page.control flow of webpages
home.jsp ->editUser.jsp -> edit.jsp
$(function(){
$("#submit").click(function(){
var a=$("#ID").val();
var b=$("#NAME").val();
var c=$("#PWD").val();
var datastring='ID=' + a + '&NAME=' + b+'&PWD='+c ;
$.ajax
({
type: "POST",
url: "edit.jsp",
data: datastring,
success: function(){
window.close();
window.location.href="home.jsp";
}
});
});
});
but this code is not working. How can I do it????