close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Drop List Value

Thread began 9/18/2011 3:46 pm by vernon webb | Last modified 2/23/2015 9:32 am by Jason Byrnes | 5543 views | 9 replies |

vernon webb

Drop List Value

I have a Dynamic Dropdown list setup which is working in the sense that when I select the parent list it populates the child list with all the correct data. However the values that are then inserted into my database do not make sense to me. What is being inserted is the matching values of the parent and child list. What I need inserted in the database is the displayed value.

Makes sense to me that it would work like that and am therefore doing something wrong but the fact that the values displayed are correct confuses me.

Anyone have any ideas?
Thanks
~V

Sign in to reply to this post

Jason ByrnesWebAssist

for each select list, create a hidden form element.

The add the following onchange event code to the select list to populate the hidden form element with the selected label:

onChange="document.<formName>.<hiddenElementName>.value = document.<formName>.select[document.<formName>.<selectListName>.selectedIndex].text"



where:
<formName> is the name of the form
<hiddenElementName> is the name of the hidden element
<selectListName> is the name of the select list.


then use the hidden element in the insert record behavior.

Sign in to reply to this post

vernon webb

The onChange is already defined as such:

onChange="WA_FilterAndPopulateSubList(rsBD_WAJA,MM_findObj('client_type'),MM_findObj('child_select'),0,0,false,': ')"

so I added to it as such but now neither works:

onChange="document.<form1>.<child_select2>.value = document.<form1>.select[document.<form1>.<child_select>.selectedIndex].text,WA_FilterAndPopulateSubList(rsBD_WAJA,MM_findObj('client_type'),MM_findObj('child_select'),0,0,false,': ')"

What am I doing wrong?

Sign in to reply to this post

Jason ByrnesWebAssist

1) seperate the 2 with a semi colon instead of a comma

2) The script I provided is an example, you need to modify the references of <formName>, <hidenElementName> and <selectListName> to use the correct values from your form page:

where:
<formName> is the name of the form
<hiddenElementName> is the name of the hidden element
<selectListName> is the name of the select list.

Sign in to reply to this post

vernon webb

Still not working. My form name is "form1", my hidden element is "child_select2" and my select list is "client_type". I assume you mean for me to remove the <> or do they need to be there?

Neither of these work and they break the dynamic dropdown list from working properly"

onChange="document.<form1>.<child_select2>.value = document.<form1>.select[document.<form1>.<client_type>.selectedIndex].text; WA_FilterAndPopulateSubList(rsBD_WAJA,MM_findObj('client_type'),MM_findObj('child_select'),0,0,false,': ')"

onChange="document.form1.child_select2.value = document.form1.select[document.form1.client_type.selectedIndex].text; WA_FilterAndPopulateSubList(rsBD_WAJA,MM_findObj('client_type'),MM_findObj('child_select'),0,0,false,': ')"

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Sweens

Hi Jason

I have a similar issue; the parent and child values are displayed correctly when used on the form, but the ParentID is entered as the ChildID into the database.

Cheers
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

in the Create Dynamic Array behavior, you have set the DistCtteeID column as both the ParantID and Child ID.

the Child ID is applied to the value of the child list.

Sign in to reply to this post

Sweens

Thanks Jason - can't see the wood for the trees!

(I must say, I find this one of the most difficult things to follow!)

Cheers
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

yeah, dynamic dropdowns is a bit difficult to follow at first, but once you get it, it makes sense

Sign in to reply to this post
loading

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...