form_saver_example.php
Gesponsorde koppelingen
PHP script bestanden
Code (php)
<!DOCTYPE html>
<html>
<head>
<title>Testing saving Forms</title>
</head>
<style>
label {
float:left;
display:block;
width:100px;
}
</style>
<body>
<form id="form" action="" method="POST">
<label>Input Text:</label>
<input type="text" id="input_text" name="input_text" onChange="f.save(this);" /><br /><br />
<label>Input Radio 1:</label>
<input type="radio" id="radio_1" name="radio" value="1" onChange="f.save(this);" /><br />
<label>Input Radio 2:</label>
<input type="radio" id="radio_2" name="radio" value="2" onChange="f.save(this);" /><br /><br />
<label>Checkbox:</label>
<input type="checkbox" id="checkbox" name="checkbox" onChange="f.save(this);" /><br /><br />
<label>Select:</label>
<select id="select" name="select" onChange="f.save(this);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select><br /><br />
<label>Textarea</label>
<textarea id="textarea" name="textarea" onChange="f.save(this);"></textarea><br /><br />
<input type="submit" name="save_form" value="Opslaan" />
</form>
<script src="form_saving.js"></script>
<script>
var f = new FormSaver('form');
</script>
</body>
</html>