PDA

View Full Version : Response for a html form submit



chot2
21 Jan 2012, 2:04 AM
I have a situation where I will be submitting a html form


<form name="sendinviteform" id="sendinviteform" onsubmit="return false;">
<input type="hidden" id="sendinvite" name="sendinvite">
</form>


var invite_detailsJson = Ext.encode(invite_details);
var inviteForm = document.getElementById('sendinviteform');

inviteForm.method = "post";
inviteForm.elements[0].value = invite_detailsJson;
inviteForm.action = servletInstallDir+'sendinvite';

formPanel.getForm('inviteForm').submit();




My question how would i handle the response while submitting this ? I have seen examples of handling ext form's respone and ajax but I was unable to find anything related to html form .Could some someone please guide me here .

nkezhaya
21 Jan 2012, 12:36 PM
Why not use a FormPanel and use submit's callback?


form.submit({
success: function() {
// code here
}
});