How do i apply validation in widget level when datatype is Date?data

Hi,


I read below URL for adding an element on the widget:-

https://community.telligent.com/community/9/w/developer-training/52490/supporting-configuration

But didn't get a solution for my query. 

Whenever I open and save widget without entering a date. It saved widget without a date. My requirement is when a user selects start date then the event should occur on DOM otherwise it shouldn't show. Date can't empty. It should always check date if it is visible.
I applied few things which are below:-

<property use="required" pattern="\d{1,2}/\d{1,2}/\d{4}" id="startdate"  dataType="date" resourceName="CF_Start_Date" value="start_date" />

Parents
  • Configuration properties do not currently support options to make them required. Some potential solutions include:

    1. When a date is not specified, use a default date (such as today).
    2. When rendering the widget, if the date is not specified, render an error from the widget (you can also do this only in preview mode so it doesn't affect other users... just the page editor).
  • There are several conditions that are mention below:
    1. That date will decide by admin only as per Event. We can't set a default date every time.
    2. Every time admin will enter a start date and End date but there is a chance of wrong input (Such as admin can put past date in the end date section or forget to enter the End date)
    That's why I need validation on widget level.

Reply Children