Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
style my text form?
Hi there,
Im trying to style my text fields. IM using the following code in my form at the moment. I want to add size=“x” in somewhere so i can control, you guessed it, the size of my fields.
Ive tried actually putting the size tag in this form in the txp tag between the dd tags but it doesnt work.
<code><txp:comments_error />
<dl>
<dt><label for=“email”><txp:text item=“email” /></label> <em>*</em></dt> <dd><txp:comment_email_input /></dd>
<dt><label for=“url”>Your URL:</label></dt> <dd><txp:comment_web_input /></dd>
<dt><label for=“comments”><txp:text item=“message” /></label> <em>*</em></dt> <dd><txp:comment_message_input /></dd>
<dt><input type=“submit” name=“submit” value=“Send Message” class=“button” /></dt> </dl></code>
Offline
#2 2006-03-02 22:07:46
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: style my text form?
The comments_form tag accepts the parameters isize
(default is “25”), msgrows
(default is “5”) and msgcols
(default is “25”).
Offline
Re: style my text form?
Hi Mary,
Thanks for the reply
Sorry to be a bit thick but im not too sure where to put that code. Ive tried putting it it my comments tags, like so:
<code><txp:comment_name_input isize=“35” /></code>
But this doesnt work. when you say comments_form tag what do you mean?
Offline
#4 2006-03-02 22:40:49
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: style my text form?
I mean the comments_form tag. ;) It should be sitting inside your comments_display form. Those parameter are given to the comments_form tag, and it looks after giving them to the appropriate inputs in the form.
Offline
Re: style my text form?
hi eldude!
you re on fire, man! I see you everywhere, like Droopy dog! ;) That’s good, you are very excited learning this marvelous little-but-powerful thing with the name of TXP!
Dont forget there is a Search tool, here and in the TextBook.
Search is your friend, and me too!
But “Search” is always there, and me… not! (of course, there other are good fellas, like this wonderful girl mary, but look at her face,: or she’s very happy of being here again or she’s getting mad!)
Most of the questions you are asking are already answered somewhere else.
Search! (in the forums, in the FAQs, and in the manual)
This doesnt mean in anyway that you shouldnt ask.
Take this just as a good advice (not a critic, I think) for you, to learn more (forums are plenty of tips and tricks ) and quickly (without waiting for a reply).
Please, feel free to ask whatever you want whenever you want. I have no doubt that you will get the answer you need.
@mary
jejeje… now it’s me asking… but I have searched before!!!!
what does the isize attribute do?
I know msgrows
and msgcols
but never read about that other one.
Thanks!
Last edited by maniqui (2006-03-02 23:01:37)
Offline
Re: style my text form?
great that works, i just cant work out how to change the size of the textarea now where the message would go. I assume i use ms grow and mscol for that but i dint know where to apply it.
Offline
#7 2006-03-02 23:18:43
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: style my text form?
Julián: that’s for the input elements (name and email), it applies the html “size” attribute.
Last edited by Mary (2006-03-02 23:19:48)
Offline
#8 2006-03-02 23:20:25
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: style my text form?
> “I assume i use ms grow and mscol for that but i dint know where to apply it.”.
That’s correct. They also get added to the comments_form tag, and it will pass it to the message textarea.
Offline
Re: style my text form?
Hi Maniqui,
Believe it or not but i do search before i post but sometimes i dont get any results that answer my questions. Im putting alot of work in on getting this intergrated in to my site at the mo, and im nearly there! Yes TXP is Great!!!
Sorry if im posting too much but i do assure you im only doing it when i need to!
By the way the isize thingy can be attributed to the comments form tag in the comments_display. By giving it a value you can change the length of textfields!
Hi Mary,
Thanks for your help. Thats working great now!
Last edited by elduderino (2006-03-02 23:23:05)
Offline
Re: style my text form?
Hello everyone,
I’ve learned (the hard way) that setting the input’s and textarea’s ‘size’ attribute produces very inconsistent results across browsers. The user-input boxes vary in width from browser to browser, consuming different percentage-widths of the enclosing element, aligning or misaligning with everything else on the page.
It seems that you get consistent results if you instead set the CSS ‘width’ of the input or textarea element. I typically size the field width via the containing div and then put a “width:100%;” in a CSS class or a ‘style’ attribute.
To accomplish this in Textpattern, you can leverage the classes it automatically puts on the form elements. The name, email, and web site elements use class “comment_web_input” and the message element uses class “txpCommentInputMessage”.
Hope that makes for prettier pages!
~joe
Offline
Pages: 1