?
avatar ggppdk
ggppdk
14 Aug 2017

Steps to reproduce the issue

Validate backend screens
you will get several
type="button" is invalid for links

Expected result

<a class="btn"

Actual result

there are cases of :

<a class="btn" type="button"

System information (as much as possible)

J3.7.4

Additional comments

Is there a reason that it is like the above ??

avatar ggppdk ggppdk - open - 14 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Aug 2017
Category Code style
avatar brianteeman
brianteeman - comment - 15 Aug 2017

Shouldnt the expected markup be
<button type="button"
??

Also you say they were changed. If you can see when there should be an explanation with the pull request that made the change

avatar ggppdk
ggppdk - comment - 15 Aug 2017

Also you say they were changed. If you can see when there should be an explanation with the pull request that made the change

i should have said they were copy-pasted

and the

<input type="button"

was made:
<a class="btn" type="button"
or
<a type="button" class="btn"
or
similar

but the type="button" was forgotten and it was not removed ,

thus we get invalid HTML markup
and i asked the question if there is a reason it was removed in some cases and it was not removed in other cases

avatar ggppdk ggppdk - change - 15 Aug 2017
Title
Invalid HTML for input-type-button that were converted to a-class-btn ???
Invalid HTML tag attribute: type="button" in some links, is it needed ?
avatar ggppdk ggppdk - edited - 15 Aug 2017
avatar ggppdk ggppdk - change - 15 Aug 2017
The description was changed
avatar ggppdk ggppdk - edited - 15 Aug 2017
avatar dgt41
dgt41 - comment - 15 Aug 2017

<button type="button" is unneeded a button has already a type button
So <a class="btn" type="button" probably should be <a class="btn" role="button"

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Aug 2017
Status New Discussion
avatar brianteeman
brianteeman - comment - 16 Aug 2017

<button type="button" is unneeded a button has already a type button

You would think so but the specification says otherwise
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
https://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html#attr-button-type

avatar ggppdk ggppdk - change - 16 Aug 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-08-16 14:03:14
Closed_By ggppdk
avatar ggppdk ggppdk - close - 16 Aug 2017
avatar ggppdk
ggppdk - comment - 16 Aug 2017

@brianteeman

i think you meant to look here: at the A tag instead of the BUTTON tag
since the discussion about INPUT and BUTTON tags was done only to understand why the invalid tag parameter (type="button") was added at the A tag

correct link is this
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

so @dgt41 is right about

So <a class="btn" type="button" probably should be <a class="btn" role="button"

in short the conclusion is that the type="button" should either be removed for links or be replaced with role="button"

avatar ggppdk ggppdk - change - 16 Aug 2017
Status Closed New
Closed_Date 2017-08-16 14:03:14
Closed_By ggppdk
avatar ggppdk ggppdk - reopen - 16 Aug 2017
avatar brianteeman
brianteeman - comment - 16 Aug 2017

no i meant exactly what I said.

avatar dgt41
dgt41 - comment - 16 Aug 2017

@brianteeman from w3c:
screen shot 2017-08-16 at 18 20 49

type="button" does nothing, so it's useless. The only time that you need it is either for submit or reset.

Now for <a> tag for accessibility we need to specify that this element should be interpreted as button not as link, thus the role="button"

avatar brianteeman
brianteeman - comment - 16 Aug 2017

@dgt41 yes it does nothing but its still valid

avatar ggppdk
ggppdk - comment - 16 Aug 2017

@brianteeman, ok, you meant what you said, i see it now. But can we stick to the original issue, i tried to make all valid html pages on backend , and i am hitting on invalid link tags, do you agree that this should be fixed ? Lets forget of the button tag ?

avatar brianteeman
brianteeman - comment - 16 Aug 2017

since you edited the original issue i no longer know what it is

avatar dgt41
dgt41 - comment - 16 Aug 2017

<a class="btn" type="button" should be <a class="btn" role="button"
I totally agree with @ggppdk here

avatar ggppdk
ggppdk - comment - 16 Aug 2017

since you edited the original issue i no longer know what it is

i did not edit description part speaking of the issue reported here
it remain exactly the same,

A tags (aka link tags) that have an invalid parameter
also original title spoke of invalid a tags that originated from input-type-button tags:

Invalid HTML for input-type-button that were converted to a-class-btn ??? to

avatar ggppdk
ggppdk - comment - 16 Aug 2017

So i will make a PR to change invalid A Tags

avatar brianteeman
brianteeman - comment - 16 Aug 2017

ok closed awaiting the pr

avatar brianteeman brianteeman - change - 16 Aug 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-08-16 21:06:38
Closed_By brianteeman
avatar brianteeman brianteeman - close - 16 Aug 2017

Add a Comment

Login with GitHub to post a comment