We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,459 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Restricting selections in jQuery UI datepicker using dynamic data

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.

2
Contributors
1
Reply
3 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
Ryujin
Light Poster
26 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

pritaeas
Posting Prodigy
Moderator
9,546 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,496
Skill Endorsements: 98

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0644 seconds using 2.74MB