<form id="form" method="post" action="">

		<label for="serial">Enter Serial Number</label>
		<input id="serial" name="serial" type="text" placeholder="e.g. SHDF3884-AEUR-D374-XXXX-XXXXXXXX" maxlength="32" />
		<small>Alphanumeric. Dashes will be added automatically.</small>

</form>
html {
  box-sizing: border-box;
	font-family: 'PT Sans', sans-serif;
-webkit-font-smoothing: antialiased;
}
*, 
*:before, 
*:after {
  box-sizing: inherit;
}
body {
	background-color: #f3f3f3;
}
form {
	width: 100%;
	max-width: 700px;
	margin: 60px auto;
}
form input {
	font-size: 30px;
	padding: 0 20px;
	border: 2px solid #ccc;
	width: 100%;
	color: #666;
	line-height: 3;
	border-radius: 7px;
	font-family: 'PT Sans', sans-serif;
	font-weight: bold;
}
form input:focus {
	outline: 0;
}
form input.error {
	border-color: #ff0000;	
}
form label.error {
	background-color: #ff0000;
	color: #fff;
	padding: 6px;
	font-size: 11px;
}

label {
	color: #999;
	display: block;
	margin-bottom: 10px;
	text-transform: uppercase;
	font-size: 18px;
	font-weight: bold;
	letter-spacing: 0.05em
}

form small {
	color: #888;
	font-size: 1em;
	margin-top: 10px;
	display: block;
	align-self: ;
}
var $form = $( "#form" );
var $input = $form.find( "input" );

$input.on( "keyup", function( event ) {

	// 1.
	var selection = window.getSelection().toString();
	if ( selection !== '' ) {
		return;
	}

	// 2.
	if ( $.inArray( event.keyCode, [38,40,37,39] ) !== -1 ) {
		return;
	}

} );

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://code.jquery.com/jquery-2.2.4.min.js