[html-formfu] HTML::FormFu::ExtJS v 0.05 and standardSubmit

Ron Savage ron at savage.net.au
Fri Oct 3 09:52:05 BST 2008


Hi Moritz

> you can pass indiviudal params to the render method:
> 
> $form->render(standardSubmit => \1);
> 
> This should add this attribute to your form.

Yep. Perfect.

And yet, it submits to the url I used to get to my logon page, not to
the url in my config file. Why is that?

Config:

---
action: /contacts/person/prepare
auto_fieldset: 1
auto_id: %n
indicator: submit

elements:
  - type: Text
    name: username
    label: Username
    attrs:
      width: 30em
    constraints: 
      - Required

  - type: Password
    name: password
    label: Password
    attrs:
      width: 30em
    constraints:
      - Required

  - type: Button
    name: submit
    default: Submit
    attrs:
      handler: function(){simple.getForm().submit()}

constraints:
  - SingleValue

Output:

Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '/ext-2.2/resources/images/default/s.gif';
var simple = new Ext.FormPanel({"standardSubmit":true,"url":"/contacts/person/prepare","items":[{"title":null,"autoHeight":1,"xtype":"fieldset","items":[{"width":"30em","hideLabel":false,"name":"username","id":null,"fieldLabel":"Username","xtype":"textfield"},{"width":"30em","hideLabel":false,"name":"password","inputType":"password","fieldLabel":"Password","id":null,"xtype":"textfield"}]}],"buttons":[{"handler":function(){simple.getForm().submit()},"text":"Submit","name":"submit","id":null}]});
simple.render("content");
});

Log:

..............................                   
http://127.0.0.1/contacts/                       
Entered logon                                    
Leaving logon                                    
..............................                   
http://127.0.0.1/contacts/?username=j&password=j 
Entered logon                                    
Param password => j                              
Param username => j                              
Leaving logon                                    

-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html





More information about the HTML-FormFu mailing list