PDA

View Full Version : Submit form like jQuery



stevo.zilik
8 Aug 2012, 3:46 PM
Hi,

I have a simple form element:


<form id="formId">
...
</form>

in jQuery, I can submit that form by calling


$('#formId').submit();


How can I do the same in Ext Js?

scottmartin
8 Aug 2012, 7:37 PM
Have a look at form.submit({..}) ;)
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.Basic-method-submit

Scott.

stevo.zilik
9 Aug 2012, 12:22 AM
Have a look at form.submit({..}) ;)
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.Basic-method-submit

Scott.

that is assuming I have an Ext.form.Basic object with Ext fields in it. But all I have is this:


<form id="formId">
<input type="text" name="lname" />
</form>

pure html, that needs to be submitted using javascript.

evant
9 Aug 2012, 12:24 AM
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Connection-method-request

See the form option.

stevo.zilik
9 Aug 2012, 12:35 AM
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Connection-method-request

See the form option.

getting there, but...

What if I don't want it to be an asynchronous ajax request, but a traditional full page POST.

evant
9 Aug 2012, 12:39 AM
Ext.getDom('formId').submit();

stevo.zilik
9 Aug 2012, 12:53 AM
Ext.getDom('formId').submit();


thanks evant, that does the trick