Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created February 15, 2011 22:21
Show Gist options
  • Save gregglind/828385 to your computer and use it in GitHub Desktop.
Save gregglind/828385 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>disabled form demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#when').attr('readonly','readonly');
$('#defaultdater').click(function(event){
$('#when').val('2/11/2089');
event.preventDefault();
});
});
</script>
</head>
<body>
<form>
When?: <input id='when' type="text" name="when" value='' />
<a href='' id='defaultdater'>choose a date</a> <!-- this could be the datepicker from jquery, for example -->
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment