I'm new to jquery mobile and need some assistance in solving an issue. I have four links in a jsp page implemented through jquery mobile framework. Each link on click opens different jquery modal dialogs.
开发者_Go百科Each link opens a new jsp in modal dialog. I have some common fields on all the dialogs and i used same ids for those fields in all the dialogs.
The issue is when i open a dialog and enter values and submits the form and comeback to parent page and again open a new dialog, the values of the common fields are showing up in the new dialog. I want to show a form with empty fields whenever i open the modal dialog. Pls help me on how to acheive this.
Sounds like you are using the same exact JSP for each modal view form.
2 options I see here:
Clear the inputs on submit of the modal form
$('#submit').click(function(){
//Empty fields here
$('#name').val('');
});
Clear inputs on pageinit
$('#modalForm').on('pageinit', function(){
$('#name').val('');
});
继续阅读:jqueryjquery-mobile
精彩评论