Focal Point
[CLOSED] On HTML page, use enter key instead of button

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/731106263

February 05, 2010, 01:42 PM
Amber
[CLOSED] On HTML page, use enter key instead of button
I have wrote two procedures, both using the same amper variable, and placed them on one html page. I have text box, where where user would enter the value for the amper. Currently, they have to click on a submit button to trigger the procedures. How can I change that for the enter key to trigger the procedures? Thanks!

This message has been edited. Last edited by: Kerry,


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
February 05, 2010, 02:40 PM
Sayed
You'll need javascript to achieve this. java script to enable enter

Thanks,
Sayed


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
February 07, 2010, 03:39 PM
Waz
Make sure that your js is cross browser compatible.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 11, 2010, 02:13 PM
Amber
I'm not comfortable with java. So, since you can't do it in the gui, I'll live with the submit button. Thanks for the suggestions.


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
February 11, 2010, 02:31 PM
njsden
quote:

I'm not comfortable with java


It is actually Javascript and you might be surprised at the cool things you can do with it. Just grab a good book or Google it; there are tons of material and great examples; you may find that it is not that difficult after all.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 11, 2010, 03:23 PM
Francis Mariani
This should be relatively easy.

I used Dev Studio HTML Layout Painter (ugh!) to create a page that has two reports embedded in it, both using the same parameter.

It automatically added the parameter as a text box, along with a Submit button and a Reset button. When I run this HTML page, I enter something in the parameter text box and click on the submit button - only one of the embedded reports runs. Alternatively, I can enter something in the text-box and press Enter - the page behaves the same way - it runs only one of the two reports.

Regarding the problem you're having Amber, it appears you can have the Enter key trigger the procedure. This seems to be default behaviour - at least with an HTML page that has a form on it.

If anyone can tell me how to get the HTML Layout Painter (ugh!) to launch both reports upon Submit I'd be a happy man.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 12, 2010, 02:18 AM
Tony A
One of the things to remember with "press enter for form submission" is that it depends upon what type of form control has focus when you hit enter. If it is anything (just about) other than a combo box then form submission should occur. However, if the focus is on a combo box then, in I.E. at least, the form will not submit on pressing the enter key.

As for submitting two (or more requests), in theory at least, you should be able to achieve this via a javascript function easily enough, but you would have to intercept the form submission by adding the onSubmit event redirection within the Submit button.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 12, 2010, 06:46 AM
Ram Prasad E
You can directly open the html code in text mode and change the "type" attribute of the control. Instead of "button" use "submit".

Example:

  
<INPUT id=btn_click type=button value=Mouse_Click name=btn_click language=javascript onclick=button1_OnClick(this)>

change "type=button" to "type=submit"

<INPUT id=btn_return type=submit value=Return_Key name=btn_return language=javascript onclick=button1_OnClick(this)>


Francis,
To trigger multiple procedures on one submit click, make use of hyperlink properties of the button control in HTML Layout painter. That allows to link to multiple procedures, which executes in parallel and displays the result in different frames or even in multiple windows.

This message has been edited. Last edited by: Ram Prasad E,


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/