Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-01-18 13:48:06
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Add classes to my zem_contact form so I can style them in the css??
As you can see below I’ve got my xhtml compliant zem_contact form which I saw an example for in another thread. I’ve tried to the best of my xhtml/css knowledge to get a class added so that I can make the actual input field longer than it is. I want it to be 200px in width, but can’t seem to get it to change.
<code>
<txp:zem_contact mailto=“deronsi@deronsizemore.com” thanksform=“contact_thanks”>
<p><txp:zem_contact_text label=“Name” class=“form_field” /></p>
<p><txp:zem_contact_email required=“1” label=“E-Mail” class=“form_field” /></p>
<p><txp:zem_contact_text label=“Subject” class=“form_field” /></p>
<p><txp:zem_contact_textarea label=“Message” required=“1” /></p>
<p><txp:zem_contact_submit label=“Send” class=“form_button” /></p>
</txp:zem_contact>
</code>
<br />
The class is called “form_field”. Here is my CSS for the corresponding class:
<br />
.form_field {
width: 200px; padding: 2px;
font: normal 12px Verdana, Arial, Helvetica, sans-serif;
}
<br />
As you can see if you view the source for the contact page, it’s not even recognizing my classes in the html…?
I’ve also done the same for the “submit” button by defining a class called “form_button” and nothing I do seems to style it either.
website: <a href=“http://www.deronsizemore.com”>HERE</a>
Last edited by deronsizemore (2006-01-18 13:51:17)
Offline
#2 2006-01-18 16:22:01
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Add classes to my zem_contact form so I can style them in the css??
Did you use zem_contact_reborn?
Offline
#3 2006-01-18 16:48:43
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Add classes to my zem_contact form so I can style them in the css??
Do I didn’t. I will try it when I get home from work tonight.
It really shouldn’t matter should it? I used this same zem_contact about a month or so ago and was able to style it with no problem.
I’ll try the reborn one tonight and see what happens.
Offline
#4 2006-01-18 16:56:56
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Add classes to my zem_contact form so I can style them in the css??
well, they added some classes to reborn so it should be easier to style the contact form by now.
Offline
#5 2006-01-18 21:35:41
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Add classes to my zem_contact form so I can style them in the css??
Cool…didn’t know that. Thanks
Offline
Re: Add classes to my zem_contact form so I can style them in the css??
If you are changing to “reborn” check your attributes. “1” and “0” are now replaced with “yes” and “no” and the “mailto” attribute is now “to”.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2006-01-19 03:06:13
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Add classes to my zem_contact form so I can style them in the css??
> thebombsite wrote:
> If you are changing to “reborn” check your attributes. “1” and “0” are now replaced with “yes” and “no” and the “mailto” attribute is now “to”.
I’ll have to read up on it, because honestly I don’t even know what the “1” and “0” did, and I definitely don’t know what the “yes” and “no” and “to” do. :)
Thanks for the heads up though.
Offline
Re: Add classes to my zem_contact form so I can style them in the css??
I was talking about things like required=1 which would now be required=“yes”.
You have to place the “mailto” attribute in the “zem_contact” tag. It’s the “mailto” email address which would normally be your own address however in the “reborn” version that has changed from “mailto” to “to”.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Add classes to my zem_contact form so I can style them in the css??
As I recall, you can do what you’re trying to do with the original zem contact; you simply go into the plugin code itself and find the size values for the desired box. So if your talking about the text input box, you look for this block of code…
<code>function zem_contact_textarea($atts) {</code>
<code>global $zem_contact_error, $zem_contact_form;</code>
<code>$label = (empty($atts[‘label’]) ? ‘Message’ : $atts[‘label’]);</code>
<code>$name = (empty($atts[‘name’]) ? preg_replace(‘/\W/’, ‘’, $label) : $atts[‘name’]);</code>
<code>$break = (!isset($atts[‘break’]) ? ‘<br />’ : $atts[‘break’]);</code>
<code>$cols = (empty($atts[‘cols’]) ? ‘50’ : $atts[‘cols’]);</code>
<code>$rows = (empty($atts[‘rows’]) ? ‘13’ : $atts[‘rows’]);</code>
<code>$min = (empty($atts[‘min’]) ? 0 : $atts[‘min’]);</code>
<code>$max = (!isset($atts[‘max’]) ? 10000 : $atts[‘max’]);</code>
<code>$default = (empty($atts[‘default’]) ? ‘’ : $atts[‘default’]);</code>
<code>$required = (empty($atts[‘required’]) ? false : true);</code>
—
and widen the “cols” value from ‘50’ to whatever you need. Note it won’t be in pixels though.
On the other hand, maybe zem contact reborn will be better in the end.
Last edited by Destry (2006-01-19 11:23:33)
Offline
#10 2006-01-19 15:17:01
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Add classes to my zem_contact form so I can style them in the css??
TheBombSite: Ohh, ha ha..I got ya now. Thanks!
Destry: Thanks for the idea. Maybe I’m just imagining it, but I could have swore I did what I’m trying to do before in the CSS. Obviously I was wrong. I’m gonna go ahead and try out the reborn contact and see what happens. I guess it’s always best to keep up with the times anyway…and since it’s the newest, I’ll use it. Thanks for the suggestion.
Offline
#11 2006-01-19 20:13:58
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Add classes to my zem_contact form so I can style them in the css??
Okay I got the “reborn” contact form installed and everything, and it works great! MUCH easier to style than the original. Thanks everyone again for the continued help. :)
Last edited by deronsizemore (2006-01-19 20:14:21)
Offline