Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-01 20:46:16

Andrej
New Member
Registered: 2006-02-01
Posts: 4

Style up my search form

How to add class or id to the search form, I cant figure it out! Help :)

I looked up the search input tag attributes on textpattern.net, but there is no class or id I could set up. I want to style up the input box and the text ofcourse.

Last edited by Andrej (2006-02-01 20:47:37)

Offline

#2 2006-02-01 21:09:20

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: Style up my search form

I think what most people do is just create one manually instead of using txp tags.

so create one using the txp tags, then view source and paste the generated html for the search form into your page – and then add class, id or whatever you want.

Offline

#3 2006-02-01 23:19:34

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: Style up my search form

> jdueck wrote:

> I think what most people do is just create one manually instead of using txp tags.

so create one using the txp tags, then view source and paste the generated html for the search form into your page – and then add class, id or whatever you want.

That’s a good idea…can you do that with most txp tags?

Offline

#4 2006-02-02 06:02:46

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Style up my search form

Why don’t you just add a fieldset (or other tag) with an id above it? For instance:
<code>
<fieldset id=“search”>
<txp:search_input label=“Search” wraptag=“p” />
</fieldset>
</code>

Then for the CSS:
<code>
#search input { width: 85px; background-color: #eee; }
#search input:focus { background-color: #FFE; }
/*et cetera */
</code>

Offline

#5 2006-02-20 01:45:00

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Style up my search form

If you add fieldset, don’t forget to add legend too (or your markup will be invalid). :)

Here’s a copy of the search form output if you really want to customize it:

<pre><code>&lt;form action=”&lt;txp:site_url /&gt;” method=“get”&gt;
&lt;p&gt;Search&lt;br /&gt;
&lt;input type=“text” name=“q” value=”“ size=“15” /&gt;&lt;/p&gt;
&lt;/form&gt;</code></pre>

Offline

Board footer

Powered by FluxBB