Advanced Subscription Start Date - How to set up?

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago - 2 years 9 months ago #154645 by David Unwin
I am trying to set up a plan with Advanced Subscription Start Date.
With this plan Users will be able to set up their own start date for the plan. We want this date to be a date in the future. i.e. minimum is tomorrow 
On the Plan in Advanced Settings, I set Subscription Start Date option to be 'Determined by Customer'
I set up  a Custom Date field for this plan and associate that custom field with the Subscription Start Date Field in Advanced settings
In the Custom Field I set type to Date
In the Data Validation settings, I want to check that the date the user enters is a date in the future. This is where I have the problem
I read the MP documentation on this  membershipprodoc.joomservices.com/basic-...scription-start-date  
and the section
membershipprodoc.joomservices.com/basic-...eld-data-client-side
in the above is information on how to set up date type validation. the text is as follows
"Date type vailidation: When you select an option, the system will insert the related rules into Validation Rules automatically. For example, when you select Min integer, the system will insert validate[required,custom[integer],min[-5]], of curse, you will need to change -5 to the correct value you want."
The setting of min integer for a date field does not sound logical to me?? does -5 mean the date is must be a least 5 days ago?
There is also another section
See  posabsolute.github.io/jQuery-Validation-Engine/#validators  for list of validators supported by this library and use the one meets your need.
But when I click on this link it does not take me anywhere as if the link is broken, so I can see anymore information on these field validations
My Question is:
1)How can I set date validation to ensure the user can only input a date in the future? i.e. Tomorrow, next day, day after next day etc.
Also, a supplementary question
 For a Cutom field type Date is it possible to set a Default Value of 'tomorrow' in the default value?
Kind regards
David
Note: I did find this on Validation
www.jqueryscript.net/form/Powerful-jQuer...lidation-Engine.html
 
Last edit: 2 years 9 months ago by David Unwin. Reason: add extra note

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #154660 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Advanced Subscription Start Date - How to set up?
Hello

You can use this rule github.com/posabsolute/jQuery-Validation...nother-elements-name

So set the validation rule to validate[required,custom[date],future[now]] . It compare to current date, not tomorrow, but it should still be useful

Regards,

Tuan
The following user(s) said Thank You: David Unwin

Please Log in or Create an account to join the conversation.

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #154672 by David Unwin
Replied by David Unwin on topic Advanced Subscription Start Date - How to set up?
Thanks Tuan,That works fine.
Just one minor issue.
I set up the Validation Error Message. However, the message is not displayed, it displays what appears to be the default message, which is not clear to a user. Is there something else I should do to display my message instead pof the default message?

For other users. Please see attached screen shot of custom field settings as propsed by Tuan

Please Log in or Create an account to join the conversation.