Combobox show label instead of value | Community
Skip to main content
Level 3
November 28, 2018
Solved

Combobox show label instead of value

  • November 28, 2018
  • 2 replies
  • 1925 views

Hi everyone,

I am pulling data from a field in DB and filling up a combo box. I want to show a different label instead of value. Even after making changes in the label, the value is still displayed. How can I force the label to be displayed in dropdown instead of value?

Please help me.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ihm185

Thank you for replying Pablo,

After I changed the label values from the frontend, the XML code looks like this.

<container colcount="1" colspan="1" id="container903" label="R1" labelPosition="inherit" style="container" type="container">

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false" id="input934" label="What solution can we help you with?*" labelPosition="inherit" required="true" targetSchema="schema:Name" targetSchemaMode="xpath" type="select">

    <storage dateFormat="DDMNY4" enum="product_interest" firstYear="1920" lastYear="2015" mode="xpath" timeFormat="none" type="string" unbound="false" useLabelAsValue="false" userEnum="" xpath="@product_interest">

        <variable xpath="jv" />

        <options>

            <option autoSqlName="true" id="IDforThisField12" label="(None specified)" origin="product_interest:" value="" />

            <option autoSqlName="true" id="IDforThisField13" label="Vendor" origin="product_interest:Digital" value="Digital" />

            <option autoSqlName="true" id="IDforThisField14" label="Operation" origin="product_interest:Software" value="Software" />

            <option autoSqlName="true" id="IDforThisField15" label="Learning" origin="product_interest:Study" value="Study" />

            <option autoSqlName="true" id="IDforThisField16" label="Agenda" origin="product_interest:Planning" value="Planning" />

        </options>

    </storage>

    <contextOptions useContext="0" xpath="productGroupEnum/enumValue-collection/enumValue" xpathLabel="@label" xpathValue="@name" />

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    </input>

</container>

Here we can see that the label is different from the value, but when the form loads in the browser its showing values instead of the label. This happens when we are storing/retrieving the value from db field but in case of storing the value to a variable it works perfectly and we can display a different label from value.

Best regards,

Imran

2 replies

pablo_rosero1
Level 9
November 30, 2018

Hi Imran,

This is done by changing label="name" in the code.

See Modifying Factory Forms in Adobe Campaign Classic |

I hope this helps!

All the best,

Pablo

ihm185AuthorAccepted solution
Level 3
December 3, 2018

Thank you for replying Pablo,

After I changed the label values from the frontend, the XML code looks like this.

<container colcount="1" colspan="1" id="container903" label="R1" labelPosition="inherit" style="container" type="container">

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false" id="input934" label="What solution can we help you with?*" labelPosition="inherit" required="true" targetSchema="schema:Name" targetSchemaMode="xpath" type="select">

    <storage dateFormat="DDMNY4" enum="product_interest" firstYear="1920" lastYear="2015" mode="xpath" timeFormat="none" type="string" unbound="false" useLabelAsValue="false" userEnum="" xpath="@product_interest">

        <variable xpath="jv" />

        <options>

            <option autoSqlName="true" id="IDforThisField12" label="(None specified)" origin="product_interest:" value="" />

            <option autoSqlName="true" id="IDforThisField13" label="Vendor" origin="product_interest:Digital" value="Digital" />

            <option autoSqlName="true" id="IDforThisField14" label="Operation" origin="product_interest:Software" value="Software" />

            <option autoSqlName="true" id="IDforThisField15" label="Learning" origin="product_interest:Study" value="Study" />

            <option autoSqlName="true" id="IDforThisField16" label="Agenda" origin="product_interest:Planning" value="Planning" />

        </options>

    </storage>

    <contextOptions useContext="0" xpath="productGroupEnum/enumValue-collection/enumValue" xpathLabel="@label" xpathValue="@name" />

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    </input>

</container>

Here we can see that the label is different from the value, but when the form loads in the browser its showing values instead of the label. This happens when we are storing/retrieving the value from db field but in case of storing the value to a variable it works perfectly and we can display a different label from value.

Best regards,

Imran