webbutton as defauld button

How can I set a Webbutton as defauld Button like in the desktop application?
In a webpage the user has to confirm the user input with an ok button and usually it only needs to press the enter key.

SetFocus to that button.

http://documentation.xojo.com/index.php/WebControl.SetFocus

mercy bien, Michel
My idea is that the user ends his input pressing the Return key to release the OK button and while writing into a webtextfield this textfield has the focus. I could ask the keypressed event for the enterkey of course. But I would have to do that for each of the other controls in the pagepage aswell. That’s a lot of work.

[quote=256403:@Christian Hahn]mercy bien, Michel
My idea is that the user ends his input pressing the Return key to release the OK button and while writing into a webtextfield this textfield has the focus. I could ask the keypressed event for the enterkey of course. But I would have to do that for each of the other controls in the pagepage aswell. That’s a lot of work.[/quote]

Put this in the WebPage KeyPressed event :

If details.CharCode = 13 then // Do whatever you would put in the default button Action end if

It will fire wherever the focus is.

I put it in the keypressed event of the most suitable controls in the webpage and that works fine.
Thank you very much.

[quote=256415:@Christian Hahn]I put it in the keypressed event of the most suitable controls in the webpage and that works fine.
Thank you very much.[/quote]

If you put it in the WebPage Keypressed event only, that will work for all controls.

sorry, obviously not while the webtextfield has the focus, at least not in RealStudio 2011.

Well…

I just tried in Mac RS 2011R4.3, and the Keypressed event of WebPage triggers whenever I press Return in a webTextField or WebTextArea which clearly has focus…