Focal Point
[SOLVED] Exec submit via an image

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

April 09, 2014, 11:08 AM
Jay Potter
[SOLVED] Exec submit via an image
I am trying to fire off the submit button onclick via an image. I plan on adding additional code to change values when the image is clicked. But at a minimum I am trying execute my report as if I clicked on the submit button. Do I need to replace crtl with a value? Here is my javascript.

//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {

}
//End function form1Submit_onclick

//Begin function image1_onclick
function image2_onclick(ctrl) {

form1Submit_onclick(ctrl);

}

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
April 09, 2014, 01:51 PM
Jay Potter
I figured this out. I added the same hyperlink to the image as the submit button, but I change the values I need to change before firing off the onclick of the image.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
April 09, 2014, 03:56 PM
J
If you still have both the submit button and the image in the page you could call the submit function passing the submit button control instead of the image control. In V.8 the code would look something like this:
 
//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {

}
//End function form1Submit_onclick

//Begin function image1_onclick
function image2_onclick(ctrl) {

form1Submit_onclick(IbComposer_getComponentById('your_submit_button_id'));

}
 

This way you wouldn't have to have to have the submit link in both the button and the image.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
April 09, 2014, 04:35 PM
Jay Potter
Thanks! I will take a look at that.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster