HTML5 mark up attribute allowed??

Issues related to forms.
User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 12:47 am

Pablo, can your form use HTML5 phone number input type attribute? Such as:

<input type='tel' pattern='\d{3}[\-]\d{3}[\-]\d{4}' title='Phone Number (Format: 999-999-9999)'>

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 7:11 am

Validation type: HTML5
Data type: custom
Custom regulate expression: \d{3}[\-]\d{3}[\-]\d{4}

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 2:41 pm

Thanks!! That should do what I want!

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 3:28 pm

I get a message in test, saying, "You must use this format:" But no format is specified. I used in General the type tel:, and in validate HTML5, with Data type: Custom. The only other space I filled in under Custom Regular Expression: I tried a bunch of different values, but none seemed to have an impact. The message "You must use this format:" is all I see when I hit Submit.

Where do I put in that format? I thought I could enter \d{3}[\-]\d{3}[\-]\d{4} in the Custom Regular Expression space.

Thanks for any help!

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 5:01 pm

I thought I could enter \d{3}[\-]\d{3}[\-]\d{4} in the Custom Regular Expression space.
The suggestion was based on your question:
Pablo, can your form use HTML5 phone number input type attribute? Such as:
<input type='tel' pattern='\d{3}[\-]\d{3}[\-]\d{4}' title='Phone Number (Format: 999-999-9999)'>
The steps in my answer generate the specified code. Whether or not it works is not up to the software. I just wanted to point you in the right direction.
The error message is displayed by the browser based on your regular expression. This is standard HTML5 functionality.

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 5:16 pm

I certainly do appreciate the point. I am going to study the html code now to see if I can find the problem.

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 5:52 pm

I can't figure out where the wording, "You must use this format:" is coming from. It is in a small box as shown in this image right after I click the submit button.

http://www.test12.info/testhtml5/youmus ... format.png

If I can find it, I would like to add ###-###-#### after it so it will make sense.

thanks

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 6:07 pm

Maybe your browser does not fully support HTML5 validation yet?
Did you try another browser?

User avatar
BaconFries
 
 
Posts: 4203
Joined: Thu Aug 16, 2007 7:32 pm

Re: HTML5 mark up attribute allowed??

Post by BaconFries » Mon Feb 05, 2018 6:34 pm

bry always best to provide a url as a image doesn't help.

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 6:58 pm

Pablo wrote:
Mon Feb 05, 2018 6:07 pm
Maybe your browser does not fully support HTML5 validation yet?
Did you try another browser?
You are so right. It is The Edge and Internet Explorer that give confusing statements. Google Chrome says, "! Please match the requested format." - which makes sense. The place holder shows "###-###-####". So,... what to do. Too many visitors will be using Windows 10 and The Edge. Rats!!! Thanks Pablo.

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 7:24 pm

Maybe the regular expression for phone validation also work with the standard validation option (Default, Info Bubble)?

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 7:55 pm

Pablo wrote:
Mon Feb 05, 2018 7:24 pm
Maybe the regular expression for phone validation also work with the standard validation option (Default, Info Bubble)?
Nope, not for me. The standard validation option is Default, Info Bubble OR HTML5 - correct?

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 9:18 pm

By 'standard validation' I meant JavaScript-based validation: Default and Info Bubble.

One more thing you can try (for Default or Info Bubble):

Code: Select all

/^(\()?\d{3}[\-]\d{3}[\-]\d{4}$/
Note that I am not a regular expression expert, so I cannot provide support on creating custom patterns.

User avatar
bry
 
 
Posts: 306
Joined: Fri Jan 11, 2008 8:44 pm

Re: HTML5 mark up attribute allowed??

Post by bry » Mon Feb 05, 2018 9:42 pm

Sorry, it didn't work for me. I give up for awhile.

If someone comes along that can integrate the javascript form into the WB form, please let me know. - bry

User avatar
Pablo
 
Posts: 14608
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: HTML5 mark up attribute allowed??

Post by Pablo » Mon Feb 05, 2018 9:52 pm

It works for me, are you sure you have set the right properties?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests