Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Drop Down for the list of zip codes in WebApp for adobe campaign classic

Avatar

Level 3

Hi Team,

 

I wanted to create a list of zipcodes in webApp in Adobe campaign classic and these zip codes are provided for the selection in the web page rather than the customers providing wrong zip codes or in valid zip codes.

 

Kindly suggest and provide me the codes if you have.

 

Thanks,

Sachin 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @sachincs1991 ,

You can achieve this in 2 ways, either by creating enumeration for zipcode in classic and hardcoding the zipcode value in it, or hardcoding the zipcode value in HTML content in webapplication.

Eg:

<html>
<body>
  <label>Zipcode:</label>
  <select id="zipcode" name="zipcode">
    <option value="city1">600001</option>
    <option value="city2">600002</option>
    <option value="city3">600003</option>
    <option value="city4">600004</option>
  </select>
  <input type="submit">
</body>
</html>
 

Regards,

ParthaSarathy S

View solution in original post

8 Replies

Avatar

Correct answer by
Community Advisor

Hi @sachincs1991 ,

You can achieve this in 2 ways, either by creating enumeration for zipcode in classic and hardcoding the zipcode value in it, or hardcoding the zipcode value in HTML content in webapplication.

Eg:

<html>
<body>
  <label>Zipcode:</label>
  <select id="zipcode" name="zipcode">
    <option value="city1">600001</option>
    <option value="city2">600002</option>
    <option value="city3">600003</option>
    <option value="city4">600004</option>
  </select>
  <input type="submit">
</body>
</html>
 

Regards,

ParthaSarathy S

Avatar

Level 3

Hi @ParthaSarathy , 

 

Thank you very much for the reply. 

 

This worked, but I am thinking still improvise it.

 

If I have 10000 zip codes it will be tough for them to do select and do so. 

 

Since zip codes are more I want give some entry in the drop down field so if I type 601 in the textbox of drop down it should show all the zip codes which starts from 601 so that customers can easily select the zip codes from the drop down.

 

Kindly suggest or help me with the code. 

 

Thanks, 

Sachin 

Avatar

Community Advisor

Hello @sachincs1991 ,

 

You can use Select 2 JS plugin to make the dropdowns searchable.

 

Here is the link to the documentation: https://select2.org/searching

 

Thank,

Manoj


     Manoj
     Find me on LinkedIn

Avatar

Level 3

Hi @Manoj_Kumar_ ,

 

I have implemented as below this is only helping to select in drop down.

I need to enter the text and help based in that or can we extract the zipcodes from the schema which is already having it.

 

 

<div class="infowidth"><select name="zipcode" id="zipcode" type="text" data-nl-bindto="xpath" data-nl-xpath="@zipCode" data-nl-label="ZipCode" data-nl-ismandatory="true" placeholder="*ZipCode">
<option value="60001">60001</option>
<option value="60002">60002</option>
<option value="60003">60003</option>
<option value="60004">60004</option>
</select></div>

 

Thanks,

Sachin

Avatar

Community Advisor
Hello @sachincs1991 I don't see select2 added to this select element. Can you share a picture of how it is rendering on the webApp?

     Manoj
     Find me on LinkedIn

Avatar

Administrator

Hi @sachincs1991,

Were you able to resolve this query or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa

Avatar

Level 3

Hi @Sukrity_Wadhwa ,

 

Required the exact code to make it work.

 

Thanks,

Sachin