There is a possible complication with using the "required" attribute and that is where a field is only required in some circumstances.
I am not sure how often, or if, this occurs in phpBB but say for example a field is required when creating a new forum but is not required when amending it - would that mean you would have two forms (with the additional overhead), have some mechanism to control when it is used or just not bother with the "required" attribute which may lead to some confusion.
Just a thought.
Make use of REQUIRED attribute in forms?
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Re: Make use of REQUIRED attribute in forms?
David
Remember: You only know what you know -
and you do not know what you do not know!
Remember: You only know what you know -
and you do not know what you do not know!
Re: Make use of REQUIRED attribute in forms?
I honestly can't think of any scenario where this would occur? If the field is already populated then the required popup thingy doesn't even display as the field is not empty.I am not sure how often, or if, this occurs in phpBB but say for example a field is required when creating a new forum but is not required when amending it
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: Make use of REQUIRED attribute in forms?
Nobody are asking to remove the back end validation but asking for add a "soft validation" by the browser, more quickly and modern to show warning to users...Going4Quests wrote: Fri May 06, 2016 8:06 pm You can check here where the required attribute is supported: http://caniuse.com/#search=required
I think it would be a great addition to include require, but the back end validation shouldnt be removed. Html attributes can be bypassed easy apparantly and also ofcourse there are browsers that dont support this.
But it wont hurt to just add this in across phpBB as an extra layer. It will work in browsers that support it improving the usage of phpBB and do no single harm in older browsers seeing attributes that arent supported are just being ignored by the browsers.
Support.
-
- Registered User
- Posts: 6
- Joined: Wed Apr 02, 2014 8:22 pm
Re: Make use of REQUIRED attribute in forms?
No reason to be rude, it was said or at least I intrepeted that someone asked to replace php validation with this. I only said that isn't needed for sure, and it can just be added as an extra layer without touching php. Done within a second. Only has benefits.
Re: Make use of REQUIRED attribute in forms?
To clarify my earlier point: only adding required attributes is not a proper solution in this case IMHO, and probably a more complete system with all the checks that are now only being performed at the backend, and possible to do on the front-end, should be done at the front-end as well, or there will be a topic in a month, suggesting to compare the two values given in the password and password confirmation field (for example).Going4Quests wrote: Sat May 07, 2016 8:55 pm No reason to be rude, it was said or at least I intrepeted that someone asked to replace php validation with this. I only said that isn't needed for sure, and it can just be added as an extra layer without touching php. Done within a second. Only has benefits.
Re: Make use of REQUIRED attribute in forms?
IMO, front-end validation (no matter how it's done) can never be a replacement for back-end validation due to security checks and such. Never trust user input.
However, is IS user-friendly to do some validation at the front-end to give a user a heads-up when they miss something prior to sending the form to the server as described in the posts above. I would like to see this addition.
However, is IS user-friendly to do some validation at the front-end to give a user a heads-up when they miss something prior to sending the form to the server as described in the posts above. I would like to see this addition.
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.
Re: Make use of REQUIRED attribute in forms?
I'm sorry.Going4Quests wrote: Sat May 07, 2016 8:55 pm No reason to be rude, it was said or at least I intrepeted that someone asked to replace php validation with this. I only said that isn't needed for sure, and it can just be added as an extra layer without touching php. Done within a second. Only has benefits.
My intent was not show me rude, my knowledge of english is very poor becose isn't my primary language (I'm Italian ).