close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Drop down list values

Thread began 2/15/2010 5:08 am by John Langer | Last modified 2/16/2010 6:28 pm by John Langer | 1621 views | 4 replies |

John LangerBeta Tester

Drop down list values

Hi,

I've successfully added a drop down list and added both spry and VTK validation. I have successfully sent the email and received it. So all is well apert from one thing:

The drop down list is populated from a dynamic list from a recordset. It has an ID that is auto-incremented. So I end up with

Value Label
1 Subject one
2 Subject two
3 Subject three etc

All basic stuff. The problem is that the email is sending the VALUE rather than the LABEL

So in the email it says:

Subject: 1

for example rather than

Subject: Subject one.

How do I alter that, so that it sends the lable rather than the value?

Many thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

A drop down list will only ever send the value, it cannot send the label. the simple solution is to use the same recordset column for bot the value and the label.

another option is to create a hidden form element and add javascript to the onchange event of the list to populate the hidden form element with the selcted label. here is an example:

<form name="form1" method="post" action="">  
<select name="select" id="select" onChange="document.form1.hiddenField.value = document.form1.select[document.form1.select.selectedIndex].text">
<option>Make a Selection</option>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
</select>
<input type="hidden" name="hiddenField" id="hiddenField"><br />
<input type="submit" name="button" id="button" value="Submit">
</form>
Sign in to reply to this post

John LangerBeta Tester

Hi Jason, thanks for the reply.

I didn't explain the full picture in my question as I thought your answer would point me in the right direction.

This recordset that populates the dropdown also has an email address associated with each subject. My idea being that you can choose a subject and that email would go to a specific recipient. Bearing in mind the full picture is there a way to do it all? Like "What's your query to do with?", "Sales", OK then choose "Sales" and the form will be submitted to the sales department.

Sign in to reply to this post

Jason ByrnesWebAssist

for that you will need to create a switch case statement to select which email address to use in universal Email. The example code below is based on the select list being named "select"

php:
<?php

switch($_POST["select"]) {
  case 
1:
    
$email "sales@email.com";
    break;
  case 
2:
    
$email "support@email.com";
    break;
  case 
3:
    
$email "marketing@email.com";
    break;
  default:
    
$email "sales@email.com";
    break; 
}
?>





then modify the universal Email code to use the $email variable:

php:
$RecipientEmail = "".($email)  ."";include("WA_Universal_Email/WAUE_contact_1.php");
Sign in to reply to this post

John LangerBeta Tester

Thanks Jason, I'll look into that.

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