Form input validation based on Memberstack field

I have a Membership website where sometimes users have to input a a form field with a ‘Code’ for an individual CMS item.

This CMS item as a this ‘Code’ stored as a field. When the form field is submitted by the user, if the input that the user submitted doesn’t match the CMS item’s ‘Code’, I want the form to show the error message.

If the forms input matches the field for the ‘Code’ in the CMS item, I want the form to show the success message.

Does anyone know how I can do this?

Hello @HORIZON

My name is Robert and I work at Memberstack. I’m thinking through your request at the moment and I believe there could be a few ways of doing this. I might need a bit more information though – sending over a read-only version of the site would probably help.

My interpretation of your request is that you’ll have a form field where, when a specific code is submitted, a specific CMS item is should be displayed. I think the easiest way to go about this would to create a conditional form structure that asks for that input and then modifies subsequent steps based on what is available. Here is a form builder that lets you do that. Just looking at that site, you could create conditional logic that takes each of those CMS items, create an if/elif/then matrix, and disable the submit (or, with a little more JS) display that error message outright. Again, it’s hard to say if this would scale properly with what you are doing because I’m not exactly sure what you want this to look like. In this specific situation, I’m not exactly sure how Memberstack would be involved.

I know this is from a few months ago, so if you ended up coming up with a solution let me know – I’d be curious to hear about it.