Javascript onsubmit clearcontent not working.
- by Azzyh
<textarea onfocus=" javascript:clearContents(this); this.cleared=true;" rows="5" cols="40" id="comment" name="comment" <?php if($vis["username"] == $pusername) { echo "DISABLED"; } ?>>...</textarea>
<input onsubmit="if (!this.comment.cleared) clearContents(this.comment); return true;" type="submit" name="Submit" value="Stem!"/>
function clearContents(element) {
element.innerHTML = '';
}
This wont work, and i cant figure out why. What it does: clears the content if it hasnt been onfocus/clicked on by the person