В этом случае вы должны использовать вместо этого атрибут readonly, поскольку это позволит дальнейшее взаимодействие с полем ввода.
ваш css
input{
margin:10px;
}
input.readonly {
color: grey;
cursor:default
}
и ваша форма
<form action="form_action.asp" method="get">
First name: <input type="text" name="fname" value="Foghorn Leghorn Foghorn Leghorn" readonly="true" class="readonly" /><br />
Last name: <input type="text" name="lname" value="" readonly="true" class="readonly" /><br />
Last name: <input type="text" name="lname" value="Foghorn Leghorn" readonly="true" class="readonly" /><br />
<input type="submit" value="Submit form" style=""/>
</form>
и ваш JQuery
$('input[readonly]').mousemove(function(){
if ($(this).val().length > 20) {
$(this).attr('data-default', $(this).width());
$(this).animate({width: 300}, 'slow');
$(this).parent().addClass('cooling');
}
});