Focal Point
HTML Textbox automatic submission?

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

August 29, 2008, 08:54 AM
Jason K.
HTML Textbox automatic submission?
I've used the HTML layout painter to create a prompt for a single amper variable in my fex.

Is there any way to make the fex execute when users hit 'enter' on their keyboard, rather than making them tab over to the submit button first?

Many users are even using their mouse to click the submit button, which is slow.

Thanks!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
August 29, 2008, 09:09 AM
Fernando
Jason,

Capture the onchange event using javascript and then have it call the function that the submit button calls.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
August 29, 2008, 09:37 AM
Jason K.
Thanks fernando.

I'm not sure what to do to have it "call the function that the submit button calls"...but I think the rest was very easy...

//Begin function edit1_OnChange
function edit1_OnChange(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function edit1_OnChange


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 04, 2008, 05:22 PM
Jason K.
I'm dumbfounded by this problem.
Is there any other way other than an onchange event?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 04, 2008, 06:38 PM
Darin Lee
It's strange to me why this is a problem. My launch pages do this by default. For example, I have one with three text boxes. Fill in the first box,tab,fill in the second box,tab, fill in the third box, hit enter, and away it goes. I'll have to look and see if I can see anything special in there that would make it do this.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 05, 2008, 02:13 AM
Tony A
Darin,

Are your submit buttons of type "submit" or "button"? From your reported experience I would guess that yours are "submit" whilst Jason's might be "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 
September 05, 2008, 06:50 AM
GamP
Hmmm, I think something else may be the case here.
I have followed the same road as Jason has (I think), which is to create a html file for a procedure that has a variable in it.
Then the entry box and submit and reset buttons are being created for me. The submit button is of type submit, and hitting the enter key indeed launches the fex. The button is also shown on the page as the default button. I then tried T's hunch, and changed the type of the submit button from submit to button. The button now does not show as default button any more, clicking on it has no effect at all, but hitting the enter key while in the data entry field still gives me the correct report.
So, we still do not know why Jason's enter does not launch the fex, while ours do.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 05, 2008, 07:42 AM
Lucas
Add this code to you web page, choose an action
where the comments are, add onkeypress = "doEnter()"
to the body tag and hit enter, choosen action shall be performed.
I should point out it will perform anytime someone hits enter (even if they did not
want it to) so I am not so sure this is what you want but it is a working example of performing an action when someone hit enter without using buttons.
<script type="text/javascript">
function doEnter(e)
{
e = (e) ? e : event;
var whatKey = (e.charCode) ? e.charCode : ((e.which) ? e.which : e.keyCode);
	if (whatKey == 13)
	{
		// To get here you had to hit enter so now you can do some stuff.
		// example.....
		//document.forms[0].submit();
		//window.location = "http://SomeFocusSever/ibi_apps/WFServlet";
                  alert("Hey you just hit the enter key!");
	}
}
</script>



7.6.6 Mainframe
7.6.4 Web Focus
Windows

September 05, 2008, 09:05 AM
Tony A
GamP,

Normally, if you create the "go" button as a tpye of "button" rather than "submit" you would do so because you want to execute some validation or other type of script before finally executing document.form.submit();.

In my experience I've not had a problem with the enter key acting on the submit button irrespective of what type of button it was.

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