Welcome to WebmasterWorld Guest from 50.16.78.128

Forum Moderators: ocean10000

Message Too Old, No Replies

textarea problem

why text inside textarea is never placed at the top

   
7:37 am on Jul 14, 2002 (gmt 0)

10+ Year Member



Greetings all,

I have a minor problem in that whenever I place dynamically generated text inside a textarea (rows=7 cols=20), the text is always positioned in the middle of the textarea. I would like to know how I can postion this text at the top of the textarea. Any ideas guys?

Thanks in advance for any solutions provided.

Smokin

7:42 am on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member



smokin, since this is the HTML forum and you mentioned dynamically generated text, what scripting language are you using?

Oh, and welcome to the board!

7:50 am on Jul 14, 2002 (gmt 0)

10+ Year Member



Thanks Marcia,

I am currently using ASP. Sorry for posting in the wrong forum, I just assume that this was a HTML bug.

Umar

7:51 am on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The text must be inserted directly after the <textarea> tag like this:

<textarea>$tezt</textarea>

Nick

7:59 am on Jul 14, 2002 (gmt 0)

10+ Year Member



Nick, that is way I have done it also
8:09 am on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does the view source look like? Do you see new lines between <textarea> and $tezt?
8:15 am on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yeah, let's see the code. This really shouldn't be a problem....

Nick

8:22 am on Jul 14, 2002 (gmt 0)

10+ Year Member



Lisa, there are no new lines between <textarea> and $tezt when viewing source.
2:13 pm on Jul 14, 2002 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Then there is something interfering. <textarea>value</textarea> should display top left in the form window.

Javascript or css on the page?

2:25 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



yes there is javascript:

<TEXTAREA rows=7 cols=20 name="message" class="txt" style="font-weight: 600;" onfocus="document.frmContact.message.style.background='#FFFFFF', document.frmContact.enquiry.disabled=false" onblur="document.frmContact.message.style.background='silver'">

do you think this could be the problem?

Smokin

2:57 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



I took out the javascript but it didnt make a difference. any other ideas?

smokin

3:00 pm on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



can you show the whole code from <textarea> to </textarea>?

Nick

3:12 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



Here you go Nick:
<%if Request("enquiry") = "Send Comments" then
%>
<td>
<TEXTAREA rows=7 cols=20 name="message" class="txt" style="font-weight: 600;" onfocus="document.frmContact.message.style.background='#FFFFFF', document.frmContact.enquiry.disabled=false" onblur="document.frmContact.message.style.background='silver'">
Thank you for your comments..
</TEXTAREA>
</td>
<%else%>
<td>
<TEXTAREA rows=7 cols=20 name="message" class="txt" onfocus="document.frmContact.message.style.background='#FFFFFF', document.frmContact.enquiry.disabled=false" onblur="document.frmContact.message.style.background='silver'">
</TEXTAREA>
</td>
<%end if%>

smokin

3:22 pm on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Try this:

<TEXTAREA rows=7 cols=20 name="message" class="txt" style="font-weight: 600;" onfocus="document.frmContact.message.style.background='#FFFFFF', document.frmContact.enquiry.disabled=false" onblur="document.frmContact.message.style.background='silver'">Thank you for your comments..</TEXTAREA>

3:29 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



already tried that, still no difference

smokin

3:29 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



Shoouldn't the CSS also be posted? I mean, his basic problem stated that text inside a textarea is positioned in the middle. I suspect there is a text-align:middle or something like that in the txt class he's assigning to the textarea.
3:31 pm on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Quite possibly but the fact that the message text is on a new line suggests a simpler explanation. Guess we wait and see....

Nick

3:34 pm on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Oops, missed Smokin's reply. Yeah, let's see the css!

Nick

4:35 pm on Jul 14, 2002 (gmt 0)

10+ Year Member



txt { COLOR: #254E0E; BACKGROUND-COLOR: #ccff99; border-width:2px; border-style: solid; border-color: #254E0E; }
9:16 am on Jul 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Did you make the form in Vis Interdev?
If so check if there are tab characters inserted in the html.