FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Weirdness in Javascript form

 


DoctorBeaver
I'm using a Javascript form with 4 text areas similar to the 1 below.

Code:
<textarea  name="misc_text" rows="3" cols="70" wrap="virtual" tabindex="4" style="position:absolute;z-index:9;left:147px;top:358px;width:432px;height:60px;font-size:10pt;font-family:Arial;font-weight:normal;font-style:normal;color:#000000;background-color:#FFFFFF;">
<?php
echo $text_comments[4];
?>
</textarea>


I'm getting the text data from a mySQL database and it displays OK except that it starts on line 2 of the text area. That means there's a blank line at the top of each. I can modify it OK (line 1 is available for entering text) and as it's only a private admin function it's not too much of a problem; just ugly and annoying.

I can't see that I'm doing anything different from where I've done the same sort of thing elsewhere but reading the data from a text file. The only difference being that in this case the data comes from the database.

I've tried trim() on the data I retrieve but it makes no difference.

Anyone got any ideas?
DoctorBeaver
OK, all of you line up ready to point & laugh at me. I forgot it's a Javascript form so where I've put <? php on a new line, it has inserted /r/n into the text.

D'OH! @ me

*whispers to the moderators "Delete this quick before they all realise what a divvy I am"*
Scorpio
HA HA HA HA

I saw that

Yay!

Phew! Somthing to laugh about for the day

thanks beaver Laughing
DoctorBeaver
grrrrrr Mad
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.