Server connect datepicker filter

I am finally getting my project rebuilt in wappler, but I am having a problem with the date filters.

how can i ensure there is no search done if the field is blank?

The Server Connect is a Form that POST.

I have a condition setup on the date_field - as a between, and the options are fieldname_start and fieldname_end. ot work great if I pick some dates, but I i do not then it only returns records that have a date of 0000-00-00

I recall an option in DW version to force the condition only if the filed was posted…

How about using form validation and mark your date fields as required?

the date_field is for filtering based on a sales date, I want this filed to be a filter option not requited, if empty should be able to return based on other filters.

my query with out the date filter will return either all records or ones that match the options selected. but when I add the date filter it only queries the records with a 0000-00-00 date and no value was passed to the sc_action.

Ah, I see what you mean. Hmmm …

Got it to work with moving the date filter to a sub group of ‘AND’

I set the group to run only if the post.fieldname contains a “-” the the same condition as mentioned before using the start & end values that the datepicker sends with the post.

2 Likes