Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Changing the Form Action Dynamically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Changing the Form Action Dynamically
 Login/Join
 
Gold member
posted
I have 2 buttons. One for Run other for Save.

On click of Save I need to call save.fex and Run I need to call Run.fex.

Also we know we need to give IBIF_EX as a hidden variable in html code.

Can we change it dynamically based on button clicked.
like

docuent.form.IBIF_EX.value = Run.fex
ELSE
docuent.form.IBIF_EX.value = Save.fex

Thanks,
CD
 
Posts: 78 | Registered: December 11, 2005Report This Post
Expert
posted Hide Post
Yes you can, if you get the syntax right.

This should be done via JavaScript in the onClick event of the appropriate button:

<input type="hidden" name="IBIF_ex">
<input type="button" value="Run" onClick="document.forms[0].IBIF_ex.value = 'RUN'; document.forms[0].submit();">
<input type="button" value="Save" onClick="document.forms[0].IBIF_ex.value = 'SAVE'; document.forms[0].submit();">



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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Working example:

<HTML>
<BODY>

<FORM action='/ibi_apps/WFServlet' method="get">
<INPUT type="hidden" name="IBIF_ex">
<INPUT type="text" name="TEXT1">
<INPUT type="button" value="BID1" onClick="document.forms[0].IBIF_ex.value = 'BID1'; document.forms[0].submit();">
<INPUT type="button" value="BID3" onClick="document.forms[0].IBIF_ex.value = 'BID3'; document.forms[0].submit();">
</FORM>

</BODY>
</HTML>


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Hi,

i did this logic inside a javascript function but on click of function I get a page canr be displayed screen

URL says

http://servername/ibi_apps/undefined

:-(

CD
 
Posts: 78 | Registered: December 11, 2005Report This Post
Expert
posted Hide Post
The URL for running my HTML page is:

http://server-name/approot/demo/runfex1.html

What version of WebFOCUS are you on? Are you using CGI or Servlet?

If it's CGI, the form action should be:

/cgi-bin/ibi_cgi/ibiweb.exe


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Now I am getting another error
I am doing





and in javascript on click of save

document.forms[0].IBIF_ex.value = 'save';
document.forms[0].submit();

Now the browser says

IBIF_ex is either null or not an object.


I am working on 7.1
 
Posts: 78 | Registered: December 11, 2005Report This Post
Gold member
posted Hide Post
quote:
Now I am getting another error
I am doing
INPUT type=hidden name="IBIC_server" value="!IBI.AMP.IBIC_server;"
INPUT type=hidden name="IBIAPP_app" value="!IBI.AMP.IBIAPP_app;"
INPUT type=hidden name="IBIF_ex" value="run"

(I have removed the '<' and '>')
and in javascript on click of save

document.forms[0].IBIF_ex.value = 'save';
document.forms[0].submit();

Now the browser says

"IBIF_ex is either null or not an object."

I am working on 7.1
 
Posts: 78 | Registered: December 11, 2005Report This Post
<Adesh>
posted
Hi,CD why dont you pass a parameter from onclick event of a button to a single function and based on the parameter excute the respective fex
eg.

< type="button" value="BID1" onClick=execute_fex[save)>Save
< type="button" value="BID3" onClick=execute_fex[run)>Run


function execute_fex(param)
{
if (param == run)
{
url="/ibi_apps/WFServlet?"+"&"+"IBIC_server=EDASERVE"+"&"+"IBIF_ex="+"RUN";
document.getElementById("iframe1").src = url;
}
else
{
put the same code with the other fex name.
}
}

This is just an example cant say it will work or not but this is one of the alternate method.
Regards
Adesh

This message has been edited. Last edited by: <Adesh>,
 
Report This Post
Virtuoso
posted Hide Post
CD
Have you got more than 1 form on the page? The forms[0] refers to the first form on the page, forms[1] would be the second, etc. The error you are getting suggests that js cannot find IBIF_ex in the first form, FORMS[0].

My preferred method is to utilise unique ids on each element and use the getElementById method, which avoids these issues. So Francis's code would become:
<HTML>
<BODY>
<FORM action='/ibi_apps/WFServlet' method="get" id="myform">
<INPUT type="hidden" name="IBIF_ex" id="canChange">
<INPUT type="text" name="TEXT1">
<INPUT type="button" value="BID1" onClick="document.getElementById('canChange').value = 'BID1';
 document.getElementById('myForm').submit();">
<INPUT type="button" value="BID3" onClick="document.getElementById('canChange').value = 'BID3'; 
document.getElementById('myForm').submit();">
</FORM>
</BODY>
</HTML>


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Changing the Form Action Dynamically

Copyright © 1996-2020 Information Builders