close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Loading all options for child while retaining teh saved value

Thread began 5/31/2010 10:01 am by keith505 | Last modified 6/01/2010 6:03 pm by Eric Mittman | 1143 views | 1 replies |

keith505

Loading all options for child while retaining teh saved value

I have a 2 drop downs, "Car Make" and "Model" on an update page for "Owners". The dependent drop down is working fine... selecting Car Make populates Car Model, and the values are saved to the database.

When returning to that update page, Car Make works normally. I can select from all of the Car Makes, but the one I saved is the default. Since Model is dependent on Car Make, it doesn't load anything, so I setup the default value of Model from the recordset.

The problem is, if I selected Nissan > Maxima (for istance), when I return to the page, I can select another Make, but not another Model unless I change the Make to something else and then change it back again, in essence, retriggering the parent child script. The model, Maxima is in the dropdown all alone with no other option.

Is there a way to load all of the option for the Model field while retaining the saved value?

Sign in to reply to this post

Eric Mittman

It will not work to populate these lists from the records that hold the selected values. As you noted you will have only a single record show in the list. The trick is to get the lists to load just like when the user made the selections. You will need to do this by calling the same function with the same values as the onChange event for your main list.

One way you could do this would be by checking the selected index, if it is anything other than 0 then a selection has been made and the code in the onChange for that select list should be executed. Executing this code with the same values should cause the next select list to be properly filtered and populated. After you execute that code you may need to check the recordset to set the selected value properly.

This is a slightly custom approach to get the dynamic dropdowns to work in this situation but if it is implemented like this it should give you the desired result. Let us know if you have any further questions on any part of this.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...