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.
I am trying to add javascript to my submit button. If the user doesn't enter in selection criteria. It is suppose to give them an alert and not execute the submit. I get it to show the alarm, but it executes the submit. What am I missing?
//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {
e1 = document.getElementById("edit1");
c1 = document.getElementById("combobox1");
if (c1.value == '' && e1.value == ''){
alert("Please enter in a value for a Product or a NDC!");
return false;
}else {
return true;
}
document.form1.submit();
}
//End function form1Submit_onclick
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
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011
The form will submit because your document.form1.submit(); statement is outside the if statement. If you put it right after the else - I'm not sure what the return true; does, try replacing that with the submit statement.
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
This is what I changed it to and it is still submitting.
//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {
e1 = document.getElementById("edit1");
c1 = document.getElementById("combobox1");
if (c1.value == '' && e1.value == ''){
alert("Please enter in a value for a Product or a NDC!");
return false;
}else {
document.form1.submit();
}
}
//End function form1Submit_onclick
WebFocus 8.1.5 iSeries/Windows DB2/SQL/Access Dev Studio App Studio Maintain ReportCaster
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011
Thank You for your suggestions. I had tried all those things before and they didn't work. So I rebuilt the form from scratch and I got it to work. I think there was a problem with the way the form was modified multiple times.
Thanks again
WebFocus 8.1.5 iSeries/Windows DB2/SQL/Access Dev Studio App Studio Maintain ReportCaster
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011
Create a new button and remove the value and add the IBI_btn-run to the class identifier. This will make the button look like the submit btn and then hide the original submit button.
If in App Studio then in the code for the new button use: IbComposer_triggerExecution(taskName, whichRequest) or in DevStudio use IbComposer_execute or just programmatically trigger the onclick event for the old submit button.
Thanks Barry
WebFOCUS 8103, Windows, App Studio
Posts: 80 | Location: NYC | Registered: November 13, 2008