PDA

View Full Version : how do I display list label instead of ID value


Jenny I
10-27-2009, 02:54 PM
Hi all,

I have a dynamic menu where users can make one selection. When the form is submitted however the value is passed so I get the ID number in my email instead od the label. How do i display the label field in my email as oppose to the value?

Jimmy Wu
10-27-2009, 05:12 PM
I'm not 100% sure on your situation, but what you can do is instead of sending the ID value in the link, you can put the label value instead. Or you can put both the label value and the ID value into the dynamic link and then you would be able to pass the label value into the email as well. If that doesn't help, please clarify your situation and how you are setting up your menu and email.

Jenny I
10-28-2009, 04:14 AM
Hi Jimmy,

I have a form with a dropdown menu populated from a recordset. The dynamic menu value is set to the ID column and the label is set to the description column of my database table. I have set it up this way because I have an insert record on this page and need to submit the ID to the database table field.

My universal email behaviour is set up to echo the form fields from my form. Unfortunately this means it is echoing the value from my dropdown menu. The value in this case is the ID. so instead of getting the description e.g.

canada

I am getting the ID e.g.


1

So my email is looking something like this e.g.

Subject: hi welcome to 1

body: thank you for enquiring about 1 today

I need it to say;

subject: welcome to canada

body: thank you for enquiring about canada today.

I am not sure how to echo this because I am binding the form element which is passing the value, which is my ID column.

Jimmy Wu
10-30-2009, 04:56 PM
Instead of getting the value from the selected item get the text from the selected item. This should be the display text that you want.

Jenny I
11-02-2009, 09:33 AM
Hi Jimmy,

Would you be able to explain how do this? It is probably straight forward but I am not sure how to get the value (ID number) into my database and then echo the label for the ID in the email, based on the selection of the user.

Jimmy Wu
11-03-2009, 03:29 PM
Could you post the code for your email so that I can point out where the change needs to be made?

Jenny I
11-04-2009, 02:21 AM
Hi Jimmy,

It is set up just to simply echo the selection made by the user dynamic menu (joblist)


Application For <?php echo ((isset($_POST["jobList"]))?$_POST["jobList"]:"")?>

Jenny I
11-10-2009, 02:18 AM
would anyone be able to help me with this please

Jimmy Wu
11-10-2009, 05:03 PM
Sorry about the slow response on the issue. Are you posting to the same page that your form is on or is it to a different page?

One way you can get the correct value into the email is to use the jobList Post variable and creating a recordset that filters on that value. You will then have the record that you want displayed and can get the value from that record.