Formbuilder: exclude select menu items after given date

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Jonny
Forum Members
Forum Members
Posts: 77
Joined: Sun Sep 24, 2006 10:49 am

Formbuilder: exclude select menu items after given date

Post by Jonny »

I have a form set up for visitors to enquire about events occurring during the current year.

The events are selected from a dropdown select menu, populated by a ***Field.class.php file that I've added.

It works fine, but I'm wondering if there is a way for events to only be included in the select menu if the current date is before a given date.

Is this something that could be done in Formbuilder's Advanced Settings for the field using Smarty or PHP conditionals?
Jonny
Forum Members
Forum Members
Posts: 77
Joined: Sun Sep 24, 2006 10:49 am

Re: Formbuilder: exclude select menu items after given date

Post by Jonny »

Oh well. Given my PHP skills, it'll have to be done with javascript :)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Formbuilder: exclude select menu items after given date

Post by calguy1000 »

if you wrote the field for formbuilder to popuplate the list it'd probably be simpler to modify the list at that time to exclude events in the past.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jonny
Forum Members
Forum Members
Posts: 77
Joined: Sun Sep 24, 2006 10:49 am

Re: Formbuilder: exclude select menu items after given date

Post by Jonny »

Thanks for your reply, Calguy.

The form has previously been updated annually: replacing the previous years events with those for the upcoming. Listing expired events may be confusing for end users, so the requirement is to remove them as they expire, without manual editing of the list.

The form was a last minute addition a couple of years back, and the site will probably be switched to more sophisticated events management in future. I have the javascript ready to roll and it'll improve the site for the majority of visitors, but a server-side solution would obviously have been preferable.
Post Reply

Return to “Modules/Add-Ons”