close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

passing labels instead of values

Thread began 8/24/2009 8:40 am by aaron322044 | Last modified 8/24/2009 12:10 pm by Jason Byrnes | 1664 views | 1 replies |

aaron322044

passing labels instead of values

I have a triple dropdown that is being used in a contact form. I understand that the dynamic dropdowns need the id to work, however I want the labels to be passed to the email form, not the id, which is what's happening. I was going to change the id values to alpha so I could get the label value, but before I do I just wanted to know if there is another option.

Sign in to reply to this post

Jason ByrnesWebAssist

you can add two hidden form elements to the page, and add javacript to the onClick event of the submit button to set the hidden form elements to the text of the list items.



The following example assumes a few conditions:
1) there is only one form on the page.
2) the two lists are named "List1" and "List2"
3) The hidden form elements are named "List1Text" and "List2Text"

<input name="button" type="submit" id="button" onclick="document.forms[0].list1Text.value = document.forms[0].list1.options[document.forms[0].list1.selectedIndex].text;document.forms[0].list2Text.value = document.forms[0].list2.options[document.forms[0].list2.selectedIndex].text" value="Submit" />





You will still get the ID values, but you will also get the text values.

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