Validation (not in a form)
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Validation (not in a form)
Hi Pablo
Created a site just a bit of fun for a friend to calculate running costs (must be loads of them) and it works fine, https://www.supake.co.uk/arc/Index.html apart from Validation.
I cannot get it to perform a validation check, eg Watts should have a value from 1 to 10000 but you can enter 0 and it does not 'check' - where am I going wrong?
TIA
Created a site just a bit of fun for a friend to calculate running costs (must be loads of them) and it works fine, https://www.supake.co.uk/arc/Index.html apart from Validation.
I cannot get it to perform a validation check, eg Watts should have a value from 1 to 10000 but you can enter 0 and it does not 'check' - where am I going wrong?
TIA
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
Validation only works with forms.
Note that I cannot help you wit custom code.
Note that I cannot help you wit custom code.
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
So if I enable form it will work? It didn't
but why?

- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
I have created a simple 1 field in a cell grid, no form and Form not enabled and that does validate as expected.
Q. Why does a new one field test work with no form but a multiple field one doesn't?
You say it only works in forms but it appears that's not the case?
Cheers
Q. Why does a new one field test work with no form but a multiple field one doesn't?
You say it only works in forms but it appears that's not the case?
Cheers
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
Please remove all custom code and then try again.
Tip: start with a simply form and make sure that works form, then add other elements.
With so many elements on the pate it is difficult me to make any sense form it without having the project.
Tip: start with a simply form and make sure that works form, then add other elements.
With so many elements on the pate it is difficult me to make any sense form it without having the project.
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Hi Pablo
I have uploaded this https://www.supake.co.uk/arc/formtest.html and the page does validate whether it's a form or not.
I have seen your response but you said earlier that only forms validate, was that incorrect? Not much point me stripping it down if that is the case (as proven above) especially if you remove that functionality in a later version.
Can you confirm that field validation DOES work whether it's a form or not?
Cheers
I have uploaded this https://www.supake.co.uk/arc/formtest.html and the page does validate whether it's a form or not.
I have seen your response but you said earlier that only forms validate, was that incorrect? Not much point me stripping it down if that is the case (as proven above) especially if you remove that functionality in a later version.
Can you confirm that field validation DOES work whether it's a form or not?
Cheers
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
The elements are part of a form (layout grid).I have uploaded this https://www.supake.co.uk/arc/formtest.html and the page does validate whether it's a form or not.
No, it was not incorrect, a layout grid is also a form.I have seen your response but you said earlier that only forms validate, was that incorrect?
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Hi Pablo
Yes, but this layout grid is not set as a form, so I checked it all based against your comment suggesting it wasn't working because it was not a form. In this case then, it was a form (despite not being set as one) so that threw me off any other checks.
I have actually now found this issue and it's nothing to do with being a form (enabled or not in a grid) and it's because the validation 'Error message:' contained an apostrophe, ie it was "What's your daily Energy Unit Cost in pence? eg 15" and is now "What is your daily Energy Unit Cost in pence? eg 15"
Do not this is not the same issue as https://www.wysiwygwebbuilder.com/forum ... 10&t=64868 as you can have brackets and ? characters, it only appears to be ' that upset it. Perhaps this is a bug?
Thanks for you help once again.
Cheers
Yes, but this layout grid is not set as a form, so I checked it all based against your comment suggesting it wasn't working because it was not a form. In this case then, it was a form (despite not being set as one) so that threw me off any other checks.
I have actually now found this issue and it's nothing to do with being a form (enabled or not in a grid) and it's because the validation 'Error message:' contained an apostrophe, ie it was "What's your daily Energy Unit Cost in pence? eg 15" and is now "What is your daily Energy Unit Cost in pence? eg 15"
Do not this is not the same issue as https://www.wysiwygwebbuilder.com/forum ... 10&t=64868 as you can have brackets and ? characters, it only appears to be ' that upset it. Perhaps this is a bug?
Thanks for you help once again.
Cheers
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
Still it's a form (container).Yes, but this layout grid is not set as a form, so I checked it all based against your comment suggesting it wasn't working because it was not a form.
In HTML/javascript, apostrophes and quotes should be escaped with \I have actually now found this issue and it's nothing to do with being a form (enabled or not in a grid) and it's because the validation 'Error message:' contained an apostrophe, ie it was "What's your daily Energy Unit Cost in pence? eg 15" and is now "What is your daily Energy Unit Cost in pence? eg 15"
What\'s your daily Energy Unit Cost in pence? eg 15
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Thanks, I didn't realise you have to do it in the editor, I presumed the editor did that when it compiled the project, etc. All noted and thanks again.
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Hmm, odd thing is that if you put
Apparently, the 'proper' way for HTML is to quote it using
you actually getWhat\'s your daily Energy Unit Cost in pence? eg 15
, ie the ' is now shown but so is the \What\'s your daily Energy Unit Cost in pence? eg 15
Apparently, the 'proper' way for HTML is to quote it using
ie the line becomes'
and this works as expected.What's your daily Energy Unit Cost in whole pence? eg 15

- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
In a related issue with Validation, I want to validate a number and that works OK for whole numbers but how do I validate a decimal, eg 12.34? The validation no longer works and thinks there's an error, ie not a number. TIA
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
I'm sorry, there is no standard option for numbers with decimals.
But you can create custom regular expressions.
But you can create custom regular expressions.
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Okidoke, cheers
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Hi Pablo and anyone else who can help?Pablo wrote: Wed Nov 27, 2019 7:04 pm I'm sorry, there is no standard option for numbers with decimals.
But you can create custom regular expressions.
Having problems creating a regular expression to validate a number only from 0 to 99 allowing 2 decimal places that works. I have got it down to ^[0-9]+(.[0-9]{1,2})?$ but that doesn't seem to work so wonder if there's an issue with Custom Validations?
There is also an oddity that may be browser based or is a bug in WWB? If you create a very simple page that has one field in it, placed in a form (Layout Grid) and set it to be a Number, eg https://www.supake.co.uk/arc/validate.html if you test the validation in Edge the field type is ignored, ie you can type text as well as numbers but if you test it in Chrome then it works except for the character e Now, I expect that's because a number can have an e (Euler's/Exponent) in it, but I can't use any other mathematical constants like i or K, etc, so suspect the e should not be allowed too. Q. Why would Edge, IE11, Safari let any text but Chrome not?
Any guidance on the RegEx appreciated.
Cheers
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
I'm sorry, I cannot help you with regular expressions.
However, this is standard HTML functionality. So, you can find lot of information about this on the Internet.
WWB dos not modify the behavior of regular expressions, so if it does not work then there is most likely a mistake in your settings.
However, this is standard HTML functionality. So, you can find lot of information about this on the Internet.
WWB dos not modify the behavior of regular expressions, so if it does not work then there is most likely a mistake in your settings.
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Okidoke, any thoughts on the validation issues between browsers?
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
It should work the same in all browsers but this is unrelated to WWB.
Regular expressions are implemented in the browser not in WWB, the expression will be published "AS IS".
Regular expressions are implemented in the browser not in WWB, the expression will be published "AS IS".
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Please re-read post, nothing to do with reg expressions. This is another issue using basic validation. Cheers
- Pablo
- Posts: 23680
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Validation (not in a form)
HTML5 validation is standard HTML functionality. It is implemented in the browser.
Please see known limitations:
https://caniuse.com/#feat=input-number
Please see known limitations:
https://caniuse.com/#feat=input-number
- Starb7
-
- Posts: 294
- Joined: Tue Sep 05, 2006 12:35 pm
- Location: Derbyshire
Re: Validation (not in a form)
Thanks for the info. Cheers