I have an admin module in magento. When the form is submitted I want to be able to show the “Please Wait” popup (the same way you get one when making changes to the categories). I am not currently using any AJAX but assume I need to submit the form using ajax. I don’t have any phtml files as my form information is set programmatically (as it’s dynamic).
Can someone point me in the right direction to use the “Please Wait” in magento, either with or without AJAX?
If you need any more information about how I am displaying the form please let me know as I don’t know what information is required and don’t want to just fill my post with random snippets.
Resolved
Just for clarity to save going through comments:
I overrode the default save button to add a JS onclick:
$this->_updateButton('save', 'onclick', 'submitForm()');
I then included a JS file using layout.xml
<reference name="head">
<action method="addJs"><script>mymodule/javascript.js</script></action>
</reference>
Then added a JS function:
function submitForm(){
$('edit_form').request({
onComplete: function() {
window.location.href = document.URL;
}
})
}
This sorted it for me.
By default in magento admin, any ajax you submit with the code below will display ‘please wait’
Take a look @
http://www.excellencemagentoblog.com/magento-admin-form-field
http://turnkeye.com/blog/magento-admin-form/