Focal Point
[Solved by Darin Lee] Easy HTML Form Question about Buttons

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

June 05, 2009, 01:21 PM
Jason K.
[Solved by Darin Lee] Easy HTML Form Question about Buttons
I've created a simple HTML form that has a button that I've linked to www.google.com using the HTML Layout Painter program. It's super simple, just the one button.

When the HTML form runs, the button doesn't do anything. I can click on it all I want, but it doesn't go to www.google.com. In fact, it just sort of sits there...it doesn't even try to open a new window. I created this HTML form because we were having the same trouble with a form we created yesterday that calls a .fex.

The code is shown below if that's relevant.

< !-- Generated by Report Layout Painter -->


<script id=IBI_OptionsScript type=text/javascript>
var rltVersion = "76";
var cgipath = "cgipath";
var ibirls = "ibirls2";

var rltdyncalendar = "rltdyncalendar";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";

var ibixmltree="ibixmltree";

var ibiOptions = new Array(cgipath,ibirls);


<script id=IBI_nls type=text/javascript src="/webquery_html/javaassist/nls.js">

<script id=IBI_ibigbl type=text/javascript src="/webquery_html/javaassist/ibi/html/js/ibigbl.js">

<script id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);

<script id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}

HtmlPage
<script id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
}
//End function window_onload


<script for=window eventname="onload">window.onload = function() { window_onload(); }












This message has been edited. Last edited by: Jason K.,


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
June 05, 2009, 03:43 PM
Darin Lee
I think the big difference is the lack of an onClick event in Jason's original code. No button will work without something defined for onClick. Don't know where it went, but it is correctly included in Tom's code


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
June 05, 2009, 03:44 PM
Dave Ayers
What's wrong with coding a simple hyperlink ?

 <a href="http://www.google.com"> Google </a> 



Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
June 05, 2009, 04:16 PM
Jason K.
the onclick handler was missing. Thanks Darin Lee.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
June 06, 2009, 12:38 AM
Doug
There's really nothing wrong with coding a simple hyperlink like
<a href="http://www.google.com"]Google[/a]
But this was done, and should work when, "using the HTML Layout Painter". With a form as simple as this one is said to be, I'd create a new one from scratch and pay particular attention to what I did or didn't do differently from the first form. It Should work...
June 08, 2009, 05:02 AM
mark66
Hi guys,

If I may ask another question whilst we are talking about buttons and events...

My users would like to have s shortcut key, such as F6, that will trigger my "Run Report" button, but I am not sure where to code it? Is it possible?

I would have thought the event would need to be on the form, but I can't see how to code for a particular button and not just any Keypress?

(Jason I hope you don't mind me bumping this question onto the bottom of your thread!)

Thanks

Mark


WebFocus 765. iSeries v5r4
June 08, 2009, 01:06 PM
Dave Ayers
Doug,

I take your point about "using the HTML Layout Painter", but my comment, was more based on good user interface design.

A hyperlink is blue, underlined text, not a button ! (Norman, Nielsen, et al)

And, while I admit to a heavy bias towards hand coding vs. IBI tools, I don't see how anyone can do much of a non- trivial nature with WebFocus, even using these tools, without an understanding of HTML.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
June 09, 2009, 10:40 AM
Tony A
Mark,

You would have to trap a onkeydown event on the form (I think).

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 
June 09, 2009, 10:47 AM
Dave Ayers
Mark,

Can you make your 'Run Report' button, the default button, so that it submits when the user hits the Enter key ?

That would be easier to implement and to use.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
June 09, 2009, 03:19 PM
dlogan
You could try this:
http://www.openjs.com/scripts/.../keyboard_shortcuts/


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


December 16, 2010, 03:15 PM
MAdams1
Mark,

I know this is an old post and you probably already have the answer, but I am so excited I actually know the answer to one of these posts. I have to share.

This code will let you designate quick keys;
onkeydown="javascript: if((13 ==event.keyCode) || (13 == event.which)) {document.getElementById('form1Submit').click();}" 


13 is the key code for the Enter key on the keyboard.
You can find a list of key codes at
http://www.cambiaresearch.com/...Codes-Key-Codes.aspx

Thanks for letting me share.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML