jQuery.maxlength demo
More information, documentation and download on the project's page : http://pioul.fr/jquery-maxlength
HTML
<script src="http://pioul.fr/ext/jquery-maxlength/jquery.maxlength.min.js"></script>
<div class="FormFirst">
</p><label for="input-1">Prefix :</label>
<input type="text" maxlength="50" id="input-1" value="" class="NameDetail"/>
<p><label for="input-2">First Name</label>
<input type="text" maxlength="50" id="input-2" value="" class="NameDetail"/>
<p><label for="input-3">Last Name</label>
<input type="text" maxlength="50" id="input-3" value="" class="NameDetail"/>
</div>
JavaScript
$('.ddd:text').attr('maxlength', 10);