Newbie assist in using Conditional Logic

  • Unknown's avatar

    I have not published my site, I’m a dabbling newbie, but am trying to figure out some Conditional Logic. But not logic for displaying fields (or not). I can think of two approaches for my need. I want to prevent a public user from Submitting a new or edited form when the contents of two Fields match an already-existing database entry.

    Example: an entry in my existing database already contains: (1) an Artist named Madonna and (2) a Song called Vogue. A user on my public form enters Madonna (for Artist) and Vogue (for Song), yet I want to prevent this new submission (since it’s already been entered).

    I’d bet here’s a better easy way, but two approaches might be:

    Method A – Find some way to gray out the Submit button when this condition exists, and display a friendly message (such as ‘This entry already exists.’) Maybe there’s an Error Checking method I can use before forms can be submitted?

    Method B – While entering the second data field (of these two), disallow its entry (somehow?) and display the friendly duplicate message.

    Since I’m new, I’m not sure what terms to use to search in the documentation and tutorials for my need. I’ll keep digging around more. Thanks in advance!

    The blog I need help with is: (visible only to logged in users)

  • Hey there,

    Many thanks for reaching out. It looks like you’re using Formidable forms – for those entries, so ultimately, they would be best advised on how to achieve that.

    However, I’ve done a search, and I found this: https://wordpress.org/support/topic/disallow-duplicate-entries/ – which has led me to this filter that they’ve built: https://formidableforms.com/knowledgebase/frm_duplicate_check_val/ to stop duplicate entries.

    It may be what you’re looking for.

    This can be added to the site using this plugin here: https://wordpress.org/plugins/code-snippets/ – as this wouldn’t damage the theme or the plugin itself.

    I hope this helps.

  • The topic ‘Newbie assist in using Conditional Logic’ is closed to new replies.