offy Posted November 17, 2010 Share Posted November 17, 2010 I have some code so when I press enter, it submits the data in textarea. But when I clear text area with document.getElementById('forminput').value = ""; The cursor stats on the second line. I think this is because of this. switch(validkey) { case 13: document.getElementById('forminput').value = ""; break; } Link to comment https://forums.phpfreaks.com/topic/219010-clearning-textarea-after-enter/ Share on other sites More sharing options...
offy Posted November 18, 2010 Author Share Posted November 18, 2010 I fixed the issue. I had to set the event on "onkeyup" instead of "onkeydown" Link to comment https://forums.phpfreaks.com/topic/219010-clearning-textarea-after-enter/#findComment-1135850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.