Strange Xception with the carraigeReturn key is "entered"

View: New views
2 Messages — Rating Filter:   Alert me  

Strange Xception with the carraigeReturn key is "entered"

by stefan.asemota :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
I have a search form, when the returnKey is "pressed" the form is submitted, despite the fact that I have an onclick button action that sends the form, and I get an Xception! The original form needs parameters before its posted!
I tried the following but I dont know how to intercept the sending of the form if the key 13 is pressed???

myField.checkKeyPress=function(){
 var keyCode = this.keypresshandler.getKeyCode();
 if (keyCode == 13) {
  //dont send form if field is empty
 }else
  // send the form
return false;
}


Re: Strange Xception with the carraigeReturn key is "entered"

by Cyril Balit :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Just set the autoSubmit property to false in the form constructor.
It prevent from this behavior

Cyril

- In rialto-dev@..., "stefan.asemota" <stefan.asemota@...> wrote:

>
> Hi
> I have a search form, when the returnKey is "pressed" the form is submitted, despite the fact that I have an onclick button action that sends the form, and I get an Xception! The original form needs parameters before its posted!
> I tried the following but I dont know how to intercept the sending of the form if the key 13 is pressed???
>
> myField.checkKeyPress=function(){
>  var keyCode = this.keypresshandler.getKeyCode();
>  if (keyCode == 13) {
>   //dont send form if field is empty
>  }else
>   // send the form
> return false;
> }
>