Return to Snippet

Revision: 46930
at May 27, 2011 19:12 by soup


Initial Code
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(document).ready(function() {

	$("#mainForm").change(function() {
		console.log("changed...");
		var data = $(this).serialize();
		console.log(data);
		$("#results").load("test2.cfm?"+data);		
	})
})
</script>
</head>

<body>

<form id="mainForm">
	name: <input type="text" name="name" /><br/>
	age: <input type="text" name="age" /><br/>
	gender: 
	<select name="gender">
		<option value="m">Male</option>
		<option value="f">Female</option>
	</select><br/>
	foo: <input type="radio" name="foo" value="1">One<br/>
	<input type="radio" name="foo" value="2">Two<br/>
	<input type="radio" name="foo" value="3">Three<br/>
	goo: <input type="checkbox" name="goo" value="1">One<br/>
	<input type="checkbox" name="goo" value="2">Two<br/>
	<input type="checkbox" name="goo" value="3">Three<br/>
	<p>
	<input type="submit">
</form>

<div id="results">
</div>

</body>
</html>

Initial URL

                                

Initial Description

                                

Initial Title
form onChange change div

Initial Tags
forms, jquery

Initial Language
jQuery