Results 1 to 3 of 3

Thread: How to call controller method from html submit button?

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default How to call controller method from html submit button?

    Hi,

    I have one plain html form. i need to call controller method from my html submit button.

    Please help me to resolve this issue.

    Thanks in Adavance

  2. #2
    Ext JS Premium Member
    Join Date
    Jul 2011
    Location
    Hyderabad, India
    Posts
    99
    Answers
    15

    Default

    Hi,

    Added a fiddle: Check this

    Thanks,
    Md Naveed
    \m/




  3. #3
    Sencha User
    Join Date
    Feb 2014
    Location
    Seattle, WA
    Posts
    1

    Default Just tailor to the URL

    Quote Originally Posted by swiji2000 View Post
    Hi,

    I have one plain html form. i need to call controller method from my html submit button.

    Please help me to resolve this issue.

    Thanks in Adavance
    If you're using extjs, you can use Ext.Ajax.request({url: '/somecontroller/somemethod/', method:'post', data: something}) from any button or div on your page

    You can also call mycontainer.getForm().submit({url:...}) which is a little clearer.

    And there are a couple of other ways too. Just check the docs for Ext.form.action.Submit.

    The controller will have a default method or you can refer to it explicitly. e.g.,
    controller = /home
    controller + method = /home/users
    contoller + method = /home/users/6
    You'll have to use the proper action/verb, such as post or get.

    Be sure to use a tool such as fiddler or firebug so you can see the actual call and its data. It helps with debugging the calls because you can see the request/response data.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •