I am trying to make a comments system like in Facebook.
Its suppose to expend the textbox dynamically.
and show the “Share” button only if something is written in the text box…
now my problem is that on firefox it works great.
but on explorer it doesn’t expend the text box or showing the share button…
What is the problem?
The Code:
js.js
document.getElementById('comments').addEventListener('keyup', function () {
this.style.height = 0; // this is necessary to make it shrink when deleting
this.style.height = this.scrollHeight + 'px';
}, false);
function ShowButton(check)
{
if (check == 1)
document.getElementById('Share').type = "submit";
else
document.getElementById('Share').type = "hidden";
}
the section of code on share.php
<tr>
<td colspan="2">
<form action="" method="post">
<textarea id ="comments" name="comments" style="width: 400px;,font-size: 16px;line-height: 1; height: 16px;" onFocus="if(this.value == 'Write something...') {this.value = ''; ShowButton(1);}" onBlur="if (this.value == '') {this.value = 'Write something...'; ShowButton(0);}">Write something...</textarea>
<br>
<div align=right>
<input id="Share" type="hidden" value="Share" class="SearchButton" style="width:50px; height:20px; border-width:0px;"/>
</div>
</form>
</td>
</tr>