Form Validation for Email Field

Issues related to forms.
Post Reply
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Form Validation for Email Field

Post by BazzaBoy »

I am trying to validate the Email Field in my on-line form. Please see screenshots:

https://petertheapostle.org/forms/validate_email_1.jpg
https://petertheapostle.org/forms/validate_email_2.jpg

However, the validation does not seem to work and the form goes through unmonitored.

I don't know what I am doing wrong. I have searched for documentation on the same.

I am having the same issue with a phone number.

Can you please help me out?
User avatar
AliGW
 
 
Posts: 222
Joined: Thu Dec 19, 2024 3:41 pm

Re: Form Validation for Email Field

Post by AliGW »

I think you need to set the MATCH field in the second dialog to match the first E-mail address field.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA).
User avatar
Pablo
 
Posts: 23439
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Validation for Email Field

Post by Pablo »

How are you testing this?
What did you expect to happen?
Do you have a demo?
Can you please be more specific?

Image
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Re: Form Validation for Email Field

Post by BazzaBoy »

What happens is, even if the email field is left blank, the form still gets submitted.

What I expect it to do, is to warn me that the field is blank or that the email format is not correct.

I have the same problem with the phone number field and drop down lists. But let's sort out one category at a time.

Simple validation for other text fields works nicely.
User avatar
Pablo
 
Posts: 23439
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Validation for Email Field

Post by Pablo »

Please share a demo.
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Re: Form Validation for Email Field

Post by BazzaBoy »

The form is quite long, but here we go:

https://petertheapostle.org/forms/baptism_request.php

It is currently delivering data to my email address, so don't worry about submitting it.

The last data I received was:

Values submitted from website form:
IP Address : 159.196.133.5
Date Of Baptism : 05/07/2025
Introduction :
Christian Name : x
Middle Name : x
Last Name : x
Date Of Birth : 2025-04-11
Place Of Birth : x
Child Gender : Male
Mother Name : y
Mother Religion : y
Mother Maiden Name : z
Father Name : z
Father Religion : z
Address : 123
Contact Number :
Contact Email :
Number Of Godparents :
Godparents Fulfil Conditions :
Godparent 1 Name :
Number Of Guests :

After the address field, it does not check anything. A few of them are drop down lists.
User avatar
AliGW
 
 
Posts: 222
Joined: Thu Dec 19, 2024 3:41 pm

Re: Form Validation for Email Field

Post by AliGW »

Did you try my suggestion? Without the MATCH field set for the second E-mail field, I doubt it will work.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA).
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Re: Form Validation for Email Field

Post by BazzaBoy »

AliGW,

Thanks for your suggestion, but there is only one email field in the entire form (Contact Email). So, I am not sure what you are trying to convey.

I think you are talking about a scenario where you enter and re-enter an email address as in a sign-up form.

Regards,
User avatar
AliGW
 
 
Posts: 222
Joined: Thu Dec 19, 2024 3:41 pm

Re: Form Validation for Email Field

Post by AliGW »

I think I misunderstood your requirement because of the names of the attachments!

Yes, I was talking about a second E-mail field that valiudates by checking against the first E-mail field.

Do as Pablo has asked and prepare and share a small demo file.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA).
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Re: Form Validation for Email Field

Post by BazzaBoy »

I prepared a small demo, and it worked just fine.

I have a feeling the cache on my Chrome is playing up.

I'll clear the cache and try again with a clean slate.

Sorry for any inconvenience.

But if it still doesn't work, I will let you know.
User avatar
Pablo
 
Posts: 23439
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Validation for Email Field

Post by Pablo »

To be able to help you, I need a DEMO project (.wbs file) so I can see all your settings.

I do not need the complete project because that will only take more time to figure out what you have done.
Basically, I just need a small project with one page and object(s) that are relevant to your question.

Note that I cannot see what you have done based on the published page (HTML), because the software has thousands of options and millions of possible combinations.
So, there is no way to know which options you have used by looking at the HTML only.

For further details about how to share a project file, please see this FAQ:
viewtopic.php?f=10&t=82134

Image
BazzaBoy
 
 
Posts: 45
Joined: Thu Jul 01, 2021 2:40 am

Re: Form Validation for Email Field

Post by BazzaBoy »

Sorry for the wait.

I have uploaded a demo as per your instructions. It is located at:
http://petertheapostle.org/forms/webform.wbs
I have removed everything else except the necessary stuff.

I have got the email thing validating properly, and replaced the dropdown lists with simple text boxes. But I am facing other issues. They are:
  • Number fields (phone number, number of godparents and number of guests) are not validating properly. I use validation as text (digits only). But it accepts and forwards anything that I type in there. I have also tried it with Number but same result.
  • Child's Date of Birth is entered as dd/mm/yyyy, but the result received by email is in the format yyyy/mm/dd. Is there any way to format that calendar?
  • Captcha entry field shows only 3 sides border. I have tried padding and margins for it to show the complete border, but with no success.
Thanks for your help.
User avatar
Pablo
 
Posts: 23439
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Validation for Email Field

Post by Pablo »

The validation does not work because there are two duplicate fields for Mother_Maiden_Name (editbox13) and Mother_Maiden_Name (editbox17).
Please remove these fields via the Object manager

The specified date format is incorrect. The correct date formats can be found here:
https://api.jqueryui.com/datepicker/

The reason why the border is not displayed is because the captcha has a fixed size in a flexible container.
I recommend to use 'full width = true' instead. In that case, you do not need to use this many breakpoints.

Note: it took me a lot of time to analyze your projectc because of the many form objects.
The next time you share a project can you please remove all non relevant element from the page?
Post Reply