Textarea enter submit

<html lang="eng">
		<title> Index Page </title>
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
		<script type"text/javascript">
		if(event.keyCode==13 && event.shiftKey) return;
		var messageBody=$('#txtMessage').val();

	<textarea id="txtMessage" col="50" rows="5" placeholder="Enter your message"></textarea>
	<div id="content" style="white-space:pre"></div>


This script shows textarea enter submit , shift+enter is new line key also after submit shows place holder message again.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s