pass the selected value as a parameter to the function call
pass the selected value as a parameter to the function call
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
thanks, it does remember the selected value now
another question, the dropdown shows option name ('text' => option a) on the page of site, but after submiting the form, i get option value ('id' => '1') in emaill, what do i get option name "option a" in email?
In the code you're using to populate the email, you would want to display $pulldown_array['text'] instead of $pulldown_array['id'].
HTH! :)
[FONT="Verdana"]If you want something done right, you have to get Zenned.
♥~-My Zen Cart Mods-~♥[/FONT]
my code in tpl file:
my code in header_php.phpPHP Code:$pulldown_array = array();
$pulldown_array[] = array('id' => '0', 'text' => please select);
$pulldown_array[] = array('id' => '1', 'text' => option a);
$pulldown_array[] = array('id' => '2', 'text' => option b);
zen_draw_pull_down_menu('pulldown', $pulldown_array)
if i select option a, i get the email content "1", but i want to get the email content "option a"PHP Code:$my_email_text = $pulldown;
if i change the code to
$my_email_text = $pulldown_array['text']
then i get nothing display in email
any help?
i added another dropdown to the form,
tpl file
headerPHP Code:zen_get_country_list('country', $country, 'id="country")
i get "223" in emailPHP Code:$my_email_text = $ecountry;
what do i get the text "United States" instead of the id "252" ?
What is defining $pulldown? $pulldown and $pulldown_array aren't the same variables.
You're collecting the displayed email data through a $_POST from the form. The value submitted through the form is "1", which is the key of the menu array, whereas "Option A" is the value of that key.
Without seeing how you've set up $pulldown, you might try something like:
And so on.PHP Code:if ($_POST['pulldown'] == '1') {
$email_display = 'Option A';
} elseif ($_POST['pulldown'] == '2') {
$email_display = 'Option B';
}
[FONT="Verdana"]If you want something done right, you have to get Zenned.
♥~-My Zen Cart Mods-~♥[/FONT]
thanks for your help, my pulldown finally works correctly
but i'm not sure what do i make my country list pulldown display country name instead of country id
there are hundreds of countries, do i have to add the code below?
if ($_POST['country'] == '223') {
$email_display = 'United States';
} elseif ($_POST['country'] == '38') {
$email_display = 'Canada';
}
...