AW.UI.Input in a form
Hi folks,
what's wrong with this code:
SOM.IO.SearchBox = AW.UI.Input.subclass();
SOM.UI.SearchBox.create = function()
{
AW.Templates.Popup.create.call(this);
var obj = this.prototype;
obj.setEvent("onkeypress", function(e) {
var keyCode = e.keyCode?e.keyCode : e.which;
if( keyCode == 13 )
{
e.returnValue = false;
}
})
// [...]
}
I want to be able to put the above control inside of a form, but disable submission when the enter key is pressed. The keypress press event gets processed by the onkeypress handler just fine, but it seems that the event doesn't get canceled and the browser still submits the form. Any suggestions?
Thanks
Dmitry
what's wrong with this code:
SOM.IO.SearchBox = AW.UI.Input.subclass();
SOM.UI.SearchBox.create = function()
{
AW.Templates.Popup.create.call(this);
var obj = this.prototype;
obj.setEvent("onkeypress", function(e) {
var keyCode = e.keyCode?e.keyCode : e.which;
if( keyCode == 13 )
{
e.returnValue = false;
}
})
// [...]
}
I want to be able to put the above control inside of a form, but disable submission when the enter key is pressed. The keypress press event gets processed by the onkeypress handler just fine, but it seems that the event doesn't get canceled and the browser still submits the form. Any suggestions?
Thanks
Dmitry
Dmitry
January 12,