Forms being submitted despite button being disabled

By: Nick Gassman | Asked: 09/13/2024
ForumsCategory: General questionsForms being submitted despite button being disabled
Nick Gassman asked 3 months ago
I have set conditional logic for the submit button to be disabled if the phone field contains a plus sign. When I use the form this works, yet I'm still receiving submissions with a plus in the phone field. How is this possible? tia
1 Answers
Rob LeVineRob LeVine answered 3 months ago
Have you checked the database to see what's getting saved? If it's just about the confirmation message you can remove it. I guess the ultimate question is how is it negatively your data?
Nick Gassman replied 3 months ago

Sorry but I don't understand. Maybe I wasn't clear. I've set up the logic to disable submit if there's a plus in the phone field on a contact form. I nevertheless receive contact emails submitted through that form that have a plus in the phone field.

Rob LeVineRob LeVine replied 3 months ago

Yes, that's what I am assuming you meant. If you choose "international" as the format, you're going to get a +[number] regardless of what you enter. What I'm saying is that you can manually remove it from the notification message if that's the part you care about. If you care about what's saved in the database, you can use a hook to remove the "+1" before it's saved (which will also fix the notification message). https://formidableforms.com/knowledgebase/frm_pre_create_entry/ is a good place to start.

Nick Gassman replied 3 months ago

Oh right. I've blocked the + as a partial method of stopping spam. This contact form is only relevant to the UK so anyone with a + is a spammer, so I don't want them. The field is not set to international. So I block the + but the spam messages still get through.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right