1,105,450 Community Members

Restricting selections in jQuery UI datepicker using dynamic data

Member Avatar
Ryujin
Light Poster
26 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Embarrassed to say how many hours I've burned on this--am hoping someone can point me down the right path. This is more a conceptual question than a straight coding one.

Building a web app to enable people to reserve stuff where I work. One of the pages uses a date range version--the user picks an equipment category and the resulting call to the database fills the page with list of items, each of which has the twin datepickers for first and last date needed.

I naïvely thought it would make sense to query the reservations table of the database in order to block out appropriate dates for items already reserved; now woe is me. Can block out dates if they are hard-coded into the array, but can't get anything dynamically generated to work. The perfectly formatted arrays show up in View Source, with a mix of dates both typed in and selected from the database, but the only ones marked on the calendars are the ones that I typed in manually.

Each text field for the datepickers gets a unique name & id. After populating the arrays using sql queries, which failed, I thought that maybe it would make a difference if I put up a couple intermediary pages for pre-processing and passed the readymade data directly via session variables. That didn't help. It only made me older.

These are ASP pages on an IIS server (v 1.1). After trying a bunch of good-looking solutions that I only dimly understood, if at all, I'm sure I'm fundamentally off target. Though it gradually dawned on me that the answer must have something to do with AJAX, I'm ignorant of what to do next. Thank you for any advice.

Member Avatar
pritaeas
mod_pritaeas
11,317 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

Did you use this method, where you direct the request to a function ?

Next to that, the datepicker has a refresh method, which should reload all settings.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: