• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Set Calendar Date Based on Time of Day

Set Calendar Date Based on Time of Day 11 years 10 months ago #23992

  • sarah72
  • sarah72's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi, I have a form set up to do online ordering and have a date field that people need to choose when yo pick up their order. I need to set a restriction that they cannot choose the same day if it is after 10am. Is there a script that I can enter to make this happen?

I already have the min date set so they cannot choose a day that is before today, but I need to place a restriction if it is past 10am that it doesn't allow them to choose the same day.

Thanks in advance.

S
The administrator has disabled public write access.

Set Calendar Date Based on Time of Day 11 years 10 months ago #24004

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
To achieve this, add the following script in the Javascript area of the CSS and Javascript tab found in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties:

<script type="text/javascript">
function rsfp_onSelectDate(selectedDate)
{
currentDate = new Date();
month=currentDate.getMonth() + 1;
today = currentDate.getDate() + "." + month + "." + currentDate.getFullYear();
hours = currentDate.getHours();
if(selectedDate == today && hours >= 10)
{
alert('enter your invalidation message here');
return false;
}
return true;
}
</script>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 11 years 10 months ago by silviup.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!