I have an input text box on a 3rd party site webpage and this webpage is simple HTML page. In the input textbox, I want to validate if entered number is valid or not.

I can do this by jquery by defining if entere number is 123 or 456, if not then alert not valid. But anyone can inspect the page and see what numbers are allowed.

I was thinking if I can save valid numbers in a data extension in marketing cloud and do an ajax call from HTML page to data extension records and check if entered number in textbox matches with records in data extension or not.

Is this possible? Any advice?

  • If my answer helped you, please mark it as accepted, so others can see my answer is correct. Thank you! – Markus Slabina Jun 20 '17 at 19:19

If this would be done from a static html-page, you would need to include the marketing cloud credentials, which are even more sensitive.

So you need to do validation in the backend of your website, which wouldn't need any integration with marketing cloud from what I can tell from your question. But if you like to store the values in a data extension anyways, you could make a call to the Marketing Cloud APIs.

What is unclear to me is how this is connected to marketing cloud or if you just thought of using Marketing Cloud data extensions as storage?

Further reading:

  • Hi Markus, Yes, you are correct, I am just thinking if I can use marketing cloud data extension as storage because i am working on a html page where obviously data can't be stored. To add validation to an input textbox, i wrote a JS script that only allow certain numbers BUT the drawback of JS script on html page is that, anyone can inspect the page and see the valid numbers and send request. So, I though of using marketing cloud DE as storage and wondering if i could talk to data extension from html page and if anything is entered in the textbox, i would check the DE data and validate. – kuml May 24 '17 at 13:18
  • This approach will allow me to store the VALID numbers in a secured place (i.e. data extension) and if I would do some kind of AJAX call or amscript lookup (which I know only works on microsite since I am working with a 3rd party HTML page here). Just need advise or ideas on how I can do this more securely? – kuml May 24 '17 at 13:19
  • I'm afraid there is no secure way that can be done from a html/js page without a secured backend, as you need to authenticate to use Marketing Cloud APIs. – Markus Slabina May 24 '17 at 13:21
  • I guess, one way to do this is to make use of microsite page or cloud page and then use ampscript (lookup). In that case, I wont be able to use HTML/JS page. I will have to use microsite hence limited to marketing cloud page domain / URL and not the main site url. – kuml May 24 '17 at 13:22
  • Yes, a microsite or a custom backend to your site would be the only options I guess. – Markus Slabina May 24 '17 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.