roscoeh23
asked on
whitespace in textarea
when I create a form it automatically inserts some whitespace, about 7 or 8 characters worth in the box,.
When I insert the $_POST data and trim it this solves the problem but how can I delete the space when the page is opened for the first time?
Ross
When I insert the $_POST data and trim it this solves the problem but how can I delete the space when the page is opened for the first time?
Ross
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forgot to wrap that function in the window onload handler:
<script type="text/javascript">
window.onload = function() {
...code goes here...
}
</script>
<script type="text/javascript">
window.onload = function() {
...code goes here...
}
</script>
hi
when u create ur form , check that all ur text ares are without spaces inside. If not, it wont be added when the page is opend
when u create ur form , check that all ur text ares are without spaces inside. If not, it wont be added when the page is opend
<script type="text/javascript">
document.getElementById('t
</script>
<body>
<textarea id="textAreaId"></textarea
</body>
Alternatively, you could do this to *every* textarea onload with the following script substitution:
<script type="text/javascript">
var elems = document.getElementsByTagN
for (var x=0, i=elems.length; x < i; x++) {
elems[x].innerHTML = "";
}
</script>