Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Webpage validation required in adobe from web form to the data in the schema

Avatar

Avatar
Validate 1
Level 2
sachincs1991
Level 2

Likes

0 likes

Total Posts

53 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
sachincs1991
Level 2

Likes

0 likes

Total Posts

53 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
sachincs1991
Level 2

25-01-2021

Hi Team,

 

We are trying to assign zipcode validation for web application in adobe campaign classic.

 

Requirement :

User should enter only the zipcode which are in zipcode schema, then only form should get submitted otherwise it should provide an alert with please enter valid zipcode.

 

In javascript of the HTML page we are using this zipcode to get all the zipcodes from the schema and store it in the array.

 

Below is the code

 

var allpincodes2 = [<% for each(var rec in new XML(xtk.queryDef.create(<queryDef schema="schemaname" operation="select" lineCount="50000"> <select> <node expr="@ZIPCODE" alias="ZIPCODE"/> </select>  </queryDef>).ExecuteQuery().toXMLString())){ %>
"<%= rec.toString().replace("<S_ZIPCODE><ZIPCODE>","").replace("</ZIPCODE></S_ZIPCODE>","") %>", <% } %> ];

 

 

$(document).ready(function () {

$(".pincode").change(function ()
{
var value = document.getElementById("pincode").value;


const filtered = allpincodes2.filter(word => word === value);
if(filtered.length == 0){
alert("Please select a zipcode from the provided zipcode list");
document.getElementById('pincode').value=null;
}
console.log(filtered);
});
});
// ]]></script>

 

Issue with the web page:

Loading time is around 15 seconds for the webpage, since it tries to assign all 47000 records from the schema to the array.

Hard coded values to the array takes around 7 to 8 seconds.

 

Required solution

Is there any other approach to bring the webpage loading time to 1 to 2 seconds?

Or

Can any one suggest different approaches to the validation of the zipcodes in text box?

 

Thanks,

Sachin C S

 

 

 

View Entire Topic

Avatar

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

102 likes

Total Posts

293 posts

Correct Reply

96 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

102 likes

Total Posts

293 posts

Correct Reply

96 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile
_Manoj_Kumar
MVP

25-01-2021

Hello Sachin,

 

You can create a jssp pages in dynamic jssp pages where in you can accept the query string for the zip code and then according to that query string you can  search for the zip code in the the adobe schema.

 

From your landing page, As soon as a customer enter the zipcode you can send an Ajax request to the jssp page and get the response and display on the landing page.

 

Thanks,

Manoj