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     [SOLVED] control - Set it as blank on page load and later populate the default value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] control - Set it as blank on page load and later populate the default value
 Login/Join
 
Guru
posted
Hi,

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,
IP

This message has been edited. Last edited by: info4pal,


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
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;


 


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Guru
posted Hide Post
Hi ,

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.

Hope Iam clear now.

Thanks,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
Maybe consider not using a fex to populate the calendar because if you don't it comes up blank when you load the page, then use JS to set the date.


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Guru
posted Hide Post
Hi,

Thanks a lot MattC and Dan....
It worked!!

Regards,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report 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     [SOLVED] control - Set it as blank on page load and later populate the default value

Copyright © 1996-2020 Information Builders