Catalog Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi all,
I am trying to configure a Date variable on a Catalog Item form so users can only select a date that is at least two weeks out from the current date. Using a Catalog Client Script, I tried scripting this function, which gives me no errors but seems to not change anything on the form.
Can anyone take a look at my script and tell me what I might be doing wrong?
Example: highlighted dates should be grayed out and not selectable:
My Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
38m ago
Hi @CesarV_,
I don't think there would be possible way to "disable" the other options.
Instead you can add a field or info message clarifying that the date must be within defined range (2 weeks from today) and if user select any date in that range then doesn't allow to submit.
It would be:
- 1a) onLoad catalog client script to show the field message ALWAYS (upon loading the form)
- 1b) onChange CCS to show if the particular field is displayed conditionally (e.g. user selects a category in another varibale, this date field becomes visible and was not visible when a form was loaded, otherwise 1a) is enough)
- 2) onSubmit CCS with return false; which makes the submission impossible
Just a small example, you need to process teh 14 days condition better, it is just to show you hwo to disabel submission
if (g_form.getValue('your_date)' > 14) {
return false;
} else {
return true;
}
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */