3

I have a dropdown on a landing page that needs to pass through the value to a data extension once the drop down selection has been chosen and the page has been submitted. I can request the parameter on the landing page, but I am unsure of how I'd set that parameter for the drop down.

       <fieldset id="reason">
        <p>Please let us know.....</p>
            <select name="reason" class="required">
                <option value="" selected>Select...</option>
                <option value="Option 1">Option 1</option>
                <option value="Option 2">Option 2</option>
                <option value="Option 3">Option 3</option>
                <option value="Option 4">Option 4</option>

                <option value="other">Other</option>
            </select>               
        </fieldset>

1 Answer 1

2

What I've done in the past is something like this:

%%[
var @title
set @title = AttributeValue("formalTitle")
]%%
<select name="Title" id="title">
    <option value="" selected="selected">Select Title</option>
    <option value="DR" %%=iif(@Title == "DR","selected='selected'","")=%%>Dr.</option>
    <option value="MR" %%=iif(@Title == "MR","selected='selected'","")=%%>Mr.</option>
    <option value="MRS" %%=iif(@Title == "MRS","selected='selected'","")=%%>Mrs.</option>
    <option value="MS" %%=iif(@Title == "MS","selected='selected'","")=%%>Ms.</option>
</select>
11
  • Does the @Title variable need to be set outside of the drop down?
    – Realrx7
    Nov 20, 2014 at 22:36
  • Yes. I've updated my answer with an example. Nov 21, 2014 at 11:27
  • When I set the @title it only passes through that value. The selected value is not being updated.
    – Realrx7
    Nov 21, 2014 at 15:17
  • I'm not sure I understand your question. Nov 21, 2014 at 15:41
  • If we set the @title = "Dr" and then select "Mr." from the dropdown, once our page executes and passes through the value, it will only pass through the value that is initially set. The drop down selection is not updating.
    – Realrx7
    Nov 21, 2014 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .