Dynamically Loaded Drop Downs Problem

I've created a few dynamically loaded drop downs that fill dependent on a response back from a MySQL query. I've filled these drop downs from my own javascript/php function i wrote as i wasn't sure the cascade box plugin would work or not for my situation.

Anyway, The form works great on the initial save. All fields get saved to the list/MySQL database, pushed to my email template and emailed, you name it... Initial save works like a charm..

However, my issue is on edit of the the list item while reviewing a previously submitted form...

All Items that were saved via the dynamically loaded drop down box are now blank in the edit view. (or i guess set back to a selectedIndex of 0 since the dynamically loaded variables weren't available yet)

I understand that fabrik loads the data to the form from the database somehow. But since the dynamically loaded drop down boxes don't have the same available values till they get loaded by my script, I am assuming fabrik is then forced to default back to a selectedindex of 0 or the original state of the drop down box prior to my scripts interaction with it.

My question is how do i grab onto the saved data that is being loaded by fabrik but failing to populate the drop down box?
How do i get access to the originally saved selected option the user selected? What would that look in Javascript?

If i could grab onto the data somehow and then populate the box again with what was previously saved... I could then ensure the data wouldn't be lost on any subsequent saves while in edit view.

Or if anyone has any additional thoughts on an easier way of doing what i'm trying to do... That would be great too...

The reason i went with my own script and query is that the data i am querying comes from a database of over 1900 select-able options... even though after the query runs that list is filtered down to 30-40 (dependent on previously selected form input)... if i was to try to program all 1900 options into the drop down box any way other than a dynamic load after query... i think it would inevitably overload the drop down box element.


Anyway, any thoughts or help with my questions would be greatly appreciated

Regards,

Sean
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top