Make use of REQUIRED attribute in forms?

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
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.
User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Make use of REQUIRED attribute in forms?

Post by david63 »

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.
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

Re: Make use of REQUIRED attribute in forms?

Post by RMcGirr83 »

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
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.
Do not hire Christian Bullock he won't finish the job and will keep your money

User avatar
Barrnet
Registered User
Posts: 10
Joined: Tue Feb 05, 2013 3:04 am

Re: Make use of REQUIRED attribute in forms?

Post by Barrnet »

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. :)
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
Registered User
Posts: 6
Joined: Wed Apr 02, 2014 8:22 pm

Re: Make use of REQUIRED attribute in forms?

Post by Going4Quests »

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. :)

CHItA
Development Team
Development Team
Posts: 169
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: Make use of REQUIRED attribute in forms?

Post by CHItA »

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. :)
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).

User avatar
Ger
Registered User
Posts: 293
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: Make use of REQUIRED attribute in forms?

Post by Ger »

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.
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.

User avatar
Barrnet
Registered User
Posts: 10
Joined: Tue Feb 05, 2013 3:04 am

Re: Make use of REQUIRED attribute in forms?

Post by Barrnet »

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. :)
I'm sorry.
My intent was not show me rude, my knowledge of english is very poor becose isn't my primary language (I'm Italian :P).

Post Reply