Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-04-02 16:21:51

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Button not Input

<txp:comment_preview /> produces
<input type="submit" value="Preview" name="preview" class="button" id="txpCommentPreview" />

<txp:comment_submit /> produces
<input type="submit" value="Submit" name="submit" class="button disabled" id="txpCommentSubmit" disabled="disabled" /> (or without disabled when appropriate)

The CSS in the Forms, Buttons and Comments portions of the default stylesheet accounts for a large part of the stylesheet and I think it could be reduced a bit, made easier to follow and at the same time made more logical by using Buttons instead of Inputs for these comment buttons.

When To Use The Button Element by Chris Coyier explains that buttons are form elements. You can have type="submit" etc. Also I always associate input with a field into which I input something and not something I ‘push’. input class="button" also goes against the grain.

I see you’ve recently changed input[type="submit"] to [type="submit] Phil, so perhaps you are already planning something? Thanks.


BB6 Band My band
Gud One My blog

Offline

#2 2016-04-02 16:55:31

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Button not Input

It would save about 3 lines of CSS, that’s all, since button and input[type=submit] share the same rules. Also button tag is more buggy to style in some (albeit older) browsers.

I also don’t utilise the button class – it’s just there as an easy hook for authors.

Offline

Board footer

Powered by FluxBB