Question: I am trying to create a **web-form that has the option to reload previously saved data**.

The problem is that when a large string of text that was entered into an autosized textarea has been saved and reloaded it adds a large amount of white space to the text area. [See before save, and after load pictures below]

BEFORE SAVE:
------------

![BEFORE SAVE](https://i.imgur.com/hwKxSf2.png)

AFTER LOAD:
-----------

![AFTER LOAD](https://i.imgur.com/3zfr0b7.png)

The form data is loaded by PHP injection of the value as in the following example:

```
<textarea class='animated' name="courseTitle" id="courseTitle"><?PHP echo ($_POST['courseTitle']) ?></textarea>

```

The form can be seen in this link. <http://pansycheung.com/forms/NewCourseProposal.php?C2EF=0>

and data can be loaded into the form in the table below (found at the bottom of the form page).

LOAD TABLE:
-----------

![LOAD TABLE](https://i.imgur.com/9vinO9E.png)

SELECT THE FIRST FILE TO LOAD 

> 
> "Phillip Test EECS3603"
> 
> 
> 

The white space disappears when doing one of the following.

* Type something into the test area
* Or adjusting the zoom in the browser

Any help with debugging suggestions would be *fantastic*.

go to ttp://pansycheung.com/forms/NewCourseProposal.php?C2EF=0 to test the form.

THANK YOU!!!

Answer: 
Using jQuery, did you try 'triggering' the autosize?

```
$('#courseTitle').trigger('autosize.resize');

```

You initially have to initialize the autosize;

```
$('#courseTitle').autosize();

```

If that still doesn't work try putting the 'trigger' autosize in a setTimeOut();

```
setTimeout(function(){ 
    $('#courseTitle').trigger('autosize.resize');
}, 1000);

```
I don't know if this works, but you can TRIM the value of the textarea with trim().
[TRIM](http://php.net/manual/en/function.trim.php)

You can also use this function in jquery, if this is necessary.