• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic Dropdowns/Requerying Table

Community Beginner ,
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

Okay, this is just a general question as I don't really have any code figured out yet. Basically, I am doing an application for the Fitness Center on the the campus I work. Users will be able to reserve pieces of the equipment via the application. So, we have the user selecting a time from one drop down. Then, we have to requery the table where the equipment resides to show what pieces of equipment are available at that specific time in the next drop down. The user will then choose the piece of equipment and then submit. I see that js and flash can be used for dynamic drop downs, however, I haven't seen anywhere that explained how to go back to the table to show items that still available or anything like that. I am guessing we will have to refresh the page, but that is not a big deal. Just curious how to get started and how to think of this. Any ideas are welcome. Thanks much in advance for your help...

Jason
TOPICS
Advanced techniques

Views

374

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

you have 2 choices

1) submit the form when the user selects a time. query the database based on the time selected to get the available pieces of equipment, re-load the form with the query data in the 2nd drop down. (i don't endorse this choice)

2) use AJAX. it's very much the same as choice #1, except the form does not submit when the time dropdown is changed. you use AJAX to go back to the server, query the database to determine which pieces of equipment are available for the selected time, then use JS to populate the 2nd drop down. this all occurs behind the scenes to the user.

I've been using the JSMX AJAX library recently for a project and liking it a lot. it's fairly lightweight (just 2 .js files), but you do need to be comfortable with JS in order to do something with the data that's returned from the AJAX call.

Spry is Adobe's AJAX library, which I think makes it a bit easier to "plug in" the data from the AJAX call after it's been returned.

JSMX can be found at http://www.lalabird.com
Spry can be found at http://labs.adobe.com/technologies/spry/

Additional info on Spry can be found at:
http://carehart.org/spry/spry_resources.cfm and http://ray.camdenfamily.com/index.cfm/AJAX

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

As well as refreshing the HTML or using AJAX, one could also do this in
FLEX, but that is a whole different ball of wax, and probable not a
great choice if one is not interested into jumping into the whole FLEX
world at this time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

If the amount of data is not large, there is a better option. Get all the data when you load the page and use related selects.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

LATEST
"better" is a subjective term 🙂

i really enjoy JS and have written plenty of JS arrays to handle related selects. nowadays tho I find it easier to just use an existing AJAX library (I lean towards JSMX) to handle the task.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation