Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#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
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
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><form action=”<txp:site_url />” method=“get”>
<p>Search<br />
<input type=“text” name=“q” value=”“ size=“15” /></p>
</form></code></pre>
Offline
Pages: 1