I have a fairly complex field interaction. I'm building a calendar app that includes location conflict checking:
- DB includes an object for Locations, connected to Events object
- When Add Event form loads, Locations field is disabled
- User must enter Start and End date/time for event
- View checks the database for any Locations which are already chosen for events that overlap that Start/End datetime
- Those conflicting Locations are removed from the available selections in the Locations field
- Locations field enabled
My thinking is:
2 happens via jQuery (disable in DOM)
4 is triggered when 3 happens
5 is done through API call
6 happens via jQuery (enable in DOM)
What I'm not sure of is:
- Is there a jQuery event triggered when a field is changed?
- Can I run such a complex filter through API? And for the filter to work, do I have to use the simpler Date/Time field choice (rather than the option to include end time and/or recurrence)?
- Can jQuery access the options in the Locations field to remove conflicting ones?
Sorry for the shotgun approach to asking the question...