Revision 6646
Added by Jing Tao about 13 years ago
lib/style/common/ajax-utils.js | ||
---|---|---|
58 | 58 |
//alert("after update"); |
59 | 59 |
} |
60 | 60 |
|
61 |
/* submits a form via ajax and inserts the results into the given div while it will reload the page. |
|
62 |
* Params: |
|
63 |
* url - url to hit |
|
64 |
* formId - id of the form to submit |
|
65 |
* divId - the name of the div where the results should be put |
|
66 |
*/ |
|
67 |
function submitFormObjIntoDivAndReload(url, formObj, divId) { |
|
68 |
var myRequest = new Ajax.Updater(divId, url, |
|
69 |
{ method: 'post', |
|
70 |
parameters: Form.serialize(formObj), |
|
71 |
onSuccess: function(reponse) { |
|
72 |
window.location.reload(); |
|
73 |
} |
|
74 |
}); |
|
75 |
} |
|
76 |
|
|
61 | 77 |
/* submits a url via ajax and inserts the results into the given div |
62 | 78 |
* Params: |
63 | 79 |
* url - url to hit |
Also available in: Unified diff
Add a new method which will reload the page after submitting a form.