PDA

View Full Version : Button in Form Reaction



mikegiddens
4 Apr 2007, 2:30 PM
Here is something that has been bugging me and I don't know why it does this reaction.

When I put a div btn tag (Ext.Button) inside a form tag it calls my handle function everytime I hit enter on a combobox and when I move it outside the form tag everything works ok.
There is nothing referencing the handle from the combo boxes.

I can live with the button being outside the form and it could be some code that is conflicting but this is very basic. I thought I would just pass this on so if it comes up again I am not the only one.

Very Stange :-/

Here is some code:

Ext.onReady(function(){

///... Some combo boxes here ....

function clearSearch(btn){
form = Ext.get("search-form");
form.dom.family.value = "";
Shell.applySearchFilter();
};
btn_search_resert = new Ext.Button("btn-search-reset",{text:'Reset', tooltip:'Reset Search Fields', handler: clearSearch});

});


<form id="search-form" class="x-form">
// ... form objects here ...

//-----------------------
// If I put it here it calls my function on the enter key of my combo boxes.
<div class="x-btn" id="btn-search-reset"></div>
//-----------------------
</form>

// If I put it here it works the way it should.
<div class="x-btn" id="btn-search-reset"></div>

jack.slocum
4 Apr 2007, 3:51 PM
This will be fixed in the next release.