Choose a location:
posted 9/5/2009 by Raghav Khunger
In this blog I will explain how to make a input field readonly with jQuery.Below is the code snippet:
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<div>
<input id="fieldName" name="fieldName" type="text" class="text_box" value="Firstname" />
</div>
</body>
<script type="text/javascript">
$(function()
{
$('#fieldName').attr('disabled', 'disabled');
});
</script>
</html>
Happy Reading.!
What kind of email newsletter would you prefer to receive from CodeAsp.Net? 18