[RESOLVED]text area content gets moved

hello there
I have a problem with the text area which holds the content of an email. Please, you can look at http://www.metatradersoftware.com, in the contact section. If you write something in the content and click Send, then you will see a second screen. Then if you click go back, you will come back to the first screen and you will still see almost the same content for the email you wrote. It’s not exactly the same because each time you go from 1st to 2nd screnen and go back, the text you wrote gets moved some positions to the right. I have checked that the session variable which holds the email content still has the correct value, that is to say, the text has not moved in this variable. Therefore, I do not know why this happens. I just might think of the cursor position as the culprit which might be moved each time I do echo “…” inside the text area of the email content but I still do not know any concrete solution.

   On the other hand, if you write something on the text area of the email subject and click send and then you click go back, you will be able to check that the text of the subject does not get moved to the right in contrast to the email content. This is weird because both text areas, the one for the subject and the one for the content are really similar.

The code:

<FORM name="email" id = "idemail" action="contact2.php" method="post">
<?php echo _("Subject");?>
<textarea name="emailsubject" id="idemailsubject" 
		onkeyup="if (this.value.length > 45) this.value = this.value.substring(0, 45)"   
                maxlength="45">
<?php
			if (isset($_SESSION['emailsubject']))
			echo $_SESSION['emailsubject'];	   
		?>				
</textarea>
<P>
<?php echo _("Content");?><br />

<TEXTAREA name="emailcontent" id="idemailcontent" rows="5" cols="50">
	<?php
		if (isset($_SESSION['emailcontent']))
		echo $_SESSION['emailcontent'];	   
	?>
 </TEXTAREA>

<?php echo "<INPUT name='send' type='submit' value='";
      echo _("Send") . ''>';		  
      echo "<INPUT type='button' value='";
      echo _("Reset") . "' onClick=resetea()>";
	?>
</P>
</FORM>	

Do you have any idea to avoid that the text from the email content gets moved when someone clicks goback from the second screen? I mean, you might think this is not a big deal for using the web. Nonetheless, it is something I am interested in learning to solve.
Thanks in advance

Mod Edit: Added CODE Tags

Doesn’t seem to do it for me so it’s difficult to say.

Thanks Chunk. Nonetheless, I already fixed it by leaving no space at all between the php echo sentences and the text area tags in which those echo printed the email content and the email subject saved in session variables.

Sponsor our Newsletter | Privacy Policy | Terms of Service