Forum Moderators: open

Message Too Old, No Replies

textarea problem

why text inside textarea is never placed at the top

         

smokin

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

Marcia

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

WebmasterWorld Senior Member 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!

smokin

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

Nick_W

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

WebmasterWorld Senior Member 10+ Year Member



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

<textarea>$tezt</textarea>

Nick

smokin

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

10+ Year Member



Nick, that is way I have done it also

Lisa

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?

Nick_W

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

WebmasterWorld Senior Member 10+ Year Member



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

Nick

smokin

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.

Brett_Tabke

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

WebmasterWorld Administrator 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?

smokin

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

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

Nick_W

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

WebmasterWorld Senior Member 10+ Year Member



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

Nick

smokin

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

Nick_W

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

WebmasterWorld Senior Member 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>

smokin

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

10+ Year Member



already tried that, still no difference

smokin

Pushycat

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.

Nick_W

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

WebmasterWorld Senior Member 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

Nick_W

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

WebmasterWorld Senior Member 10+ Year Member



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

Nick

smokin

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; }

aspdaddy

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.