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 have a calendar control and Iam trying to dynamically populate the calendar control with last 1 month's date as the default date through the help of a fex.
The requirement is intially as soon as I run the Html/parameter page, the calendar should be blank and only upon clicking on the calendar control,the default date i.e, last 1 month's date should begin populated but right now the default date is getting populated as soon as the page loads.
Can anyone please let me know how to do this in javascript?
Any help is greatly appreciated!! Thanks a lot in advance...
Regards, IPThis message has been edited. Last edited by: info4pal,
Here is some JS, that you can use to set the date to last month or X amount of days from current day. Maybe you can use this or it will give you some other ideas.
var Today = new Date();
Today.setDate(Today.getDate() -2);
Today.toLocaleDateString();
var DateMM = Today.getMonth() + 1; // javascript months are 0 through 11
var DateDD = Today.getDate();
var DateYYYY = Today.getFullYear();
if (DateMM < 10) DateMM = '0' + DateMM;
if (DateDD < 10) DateDD = '0' + DateDD;
var formdate = DateMM + '/' + DateDD + '/' + DateYYYY;
document.form1.calendar1.value=formdate;
document.form1.calendar2.value=formdate;
Thanks Mattc for the quick response and for the solution. Actually I can populate the default values through the help of a fex but the problem is I need to know how to keep the default date as blank when the page loads and only upon clicking on the calendar control,the default date say last 1 month's date should get populated.
Usually there is a JS function named window_onload() near the top of the HTML. You might be able to set the value of the calendar control to blank in that function.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007