Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-09 08:51:21

userAnterface
Member
Registered: 2007-09-07
Posts: 16

Assigning classes to form input elements

How do I assign a class to <txp:comment_name_input /> ?

Offline

#2 2007-09-09 09:13:24

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Assigning classes to form input elements

Surround it with a span/div that has the desired class. Or just set a generic style for the INPUT tag.

Last edited by ruud (2007-09-09 09:48:05)

Offline

#3 2007-09-09 09:37:24

userAnterface
Member
Registered: 2007-09-07
Posts: 16

Re: Assigning classes to form input elements

Using/span sounds inefficient. A generic style would affect buttons too, I am looking to make some width adjustments. Is there no way to assign a class directly to input?

Offline

#4 2007-09-09 09:47:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Assigning classes to form input elements

They already have classes by default.

Offline

#5 2007-09-09 10:00:13

userAnterface
Member
Registered: 2007-09-07
Posts: 16

Re: Assigning classes to form input elements

I tried <txp:comment_name_input class=“mc” /> but I am getting

Tag error: <txp:comment_name_input class=“mc” /> -> Textpattern Warning: tag does not exist on line 973

Could your hint me on how to modify the class values if they already have by default?

Offline

#6 2007-09-09 10:18:21

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Assigning classes to form input elements

The only way to modify them is by hacking the TXP code (textpattern/publish/comments.php). This is not recommended, as it makes it difficult to upgrade.

Why can’t you use the default classes the input elements have. They should be unique enough to style properly.

Offline

Board footer

Powered by FluxBB