The CreatorCon Call for Content is officially open! Get started here.

start date should be today + 2 business days

Thomas99
Tera Contributor

Posting this again as I could not get it working:

 

Hi

 

Can someone please help me with catalog client script (on change) and script include

 

I have a date variable in the new hire form.

The requirement is users should only be allowed to select the "start date" as current date + 2 business days (exclude sat-sun). 

 

Example: If I'm filling the form today , (Oct 11) the start date should be Oct 14 or further. User should not be be able to select an ealier date and should give an error " Invalid date" 

 

Thanks,

21 REPLIES 21

Thank you. I've implemented it and will test it on Thursday.

 

It allows me to select dates past 48 hours, which is great, but I need to test the weekend thing. 

 

One more help please, 

 

how do get var message (screenshot below) than a popup? 

pop-up doesnt seem to work well in the service portal.  (I tried it in the script you provided and didnt work). 

 

Thomas99_0-1697479355766.png

 

 

 

Thanks Again. 

@Thomas99 you can use showFieldMsg() to display the error at field. Change the if block to the one like below.

 

if (answer == 'true') {

            g_form.setValue('lpar_refreshed', '');

g_form.showFieldMsg("lpar_refreshed", "Please select atleast 48hrs or more from now", "error");

}

Thanks,
Anvesh

did not work 😞 

Allows me to select any date now. 

 

Thomas99_0-1697512342631.png

 

Can you please review my code above? The change you recommended did not wort. 

did not work 

 

 

Allows me to select any date now. 

Can you please review my code?

 

Thomas99_1-1697908884493.png