Ben
Ben

Reputation: 62356

How to submit a form via ExtJS

Ext.get('login-openid-form').submit();

This isn't working, what should I be doing?

Upvotes: 0

Views: 2665

Answers (1)

timdev
timdev

Reputation: 62874

Ext.get() returns an Ext.Element, not the underlying DOM element.

The underlying element is in a property called .dom.

Try:

Ext.get('login-openid-form').dom.submit();

EDIT

If you want to get more Ext-y, you can start to leverage Ext.form.BasicForm:

var form = new Ext.form.BasicForm('login-openid-form', { standardSubmit : true });
form.submit();

That will expose a more robust form API, which is beyond the scope of this answer, but the docs (linked above) are pretty good.

Upvotes: 4

Related Questions