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’m using App Studio – HTML Composer with GUI. Within my page I have two calendar controls and a submit button. My goal is to perform a date validation and then stop processing in the event of a validation error. Using JavaScript I was able to do the date validation and throw an alert, but the form is still processing. Is there a way to prevent the submission of the form? I tried using ‘return false’ but that didn’t work. I have a few workarounds I can do, such as using JavaScript to submit the reports instead of the GUI, or I could hide the reports on a date validation error, but hopefully there is an easier way. Thanks!This message has been edited. Last edited by: Joel Elscott,
Yes it can be done. Write a function named eg. onValidate()
function onValidate() { if(your validation is true) { return(0); //it will redirect to run the procedure } else { return(2); //it will stops the report execution } }
This function should be called in the Tasks & Animations by creating a new Requests/Actions => "Javascript Call", Target Type => JavaScript Function, Function Name => onValidate
Followed by this request your procedure should be added next in Requests/Actions.
@subbu_088 - this worked perfectly! Thank you! This is the first time I've seen "return(2)" being used, but that's exactly what I needed.
@Squatch - Thank you for the suggestion, but unfortunately I couldn't get event.stopImmediatePropagation to work correctly. It stopped the JavaScript from processing, but then I couldn't get it restarted again when I fixed the date and resubmitted the form. Using Firebug I see that stopImmediatePropagation was an unknown function.
@Squatch - Thank you for the suggestion, but unfortunately I couldn't get event.stopImmediatePropagation to work correctly. It stopped the JavaScript from processing, but then I couldn't get it restarted again when I fixed the date and resubmitted the form. Using Firebug I see that stopImmediatePropagation was an unknown function.
It will be unknown if you don't have "event" declared in your function:
function form1Submit_onclick(event) {
Actually, it doesn't have to be "event"... it could be "e" or whatever else you want to call it. You just need to declare something so JavaScript can fill it with data and functions related to whatever the user clicked on.
So if you declare it as "e" in your function, you would call it like this:
e.stopImmediatePropagation();
You already have another solution, so I'm posting this in case anyone else wants to try it. It works fine for me.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
@Squatch - Thanks again, the solution you mentioned did fix the unknown function error I was receiving. However it still won't let resubmit the form/submit button after I correct the date. It's like it stops everything on the page I can't do anything after I punch in a bad date. I do have another solution though, so I will definitely keep this in mind for in the future.