Skip to content

Instantly share code, notes, and snippets.

@deplorableword
Created June 17, 2009 12:51
Show Gist options
  • Save deplorableword/131220 to your computer and use it in GitHub Desktop.
Save deplorableword/131220 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>jquery form element disable</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script text="text/javascript">
$(document).ready(function(){
$(".cheese").click(function(event){
$(".q").attr("disabled", "disabled");
});
});
</script>
</head>
<body>
<form action="http://www.google.co.uk/">
<input type="text" name="q" class="q" />
<input type="text" name="w" class="w" />
<input type="submit" class='cheese' />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment