Hi,
I am looking for get the text of a dropdown in the email. Text not value.
I have seem this.
It works fine but my dropdown is dynamicly generated from a table of the database (contact detail ) as id=>name
I know that a dropdown with value = text will solve the problem but i need id as value, because i use it to get other data by ajax.
Any help
Regards
I am looking for get the text of a dropdown in the email. Text not value.
I have seem this.
<?php
$color_array = array(
1 => 'green',
2 => 'blue',
3 => 'red',
4 => 'white'
);
$form->data['color_name'] = $color_array[$form->data['color']];
?>
It works fine but my dropdown is dynamicly generated from a table of the database (contact detail ) as id=>name
I know that a dropdown with value = text will solve the problem but i need id as value, because i use it to get other data by ajax.
Any help
Regards
Hi juansolos,
There are two ways to do this:
One is to use a DB Read action or a Custom Code action to look up the matching database record and read the values that you need,
The other is to build the dynamic values using both the id and the text e.g. 1#green=green then you can use a custom code action in the On Submit event to separate the two parts into separate $form->data entries.
Bob
There are two ways to do this:
One is to use a DB Read action or a Custom Code action to look up the matching database record and read the values that you need,
The other is to build the dynamic values using both the id and the text e.g. 1#green=green then you can use a custom code action in the On Submit event to separate the two parts into separate $form->data entries.
Bob
This topic is locked and no more replies can be posted.