
JqueryUpdater
By: a guest on
Apr 8th, 2011 | syntax:
HTML | size: 1.20 KB | hits: 107 | expires: Never
// this is the ajax loading mechanism, I sniped the ajax code cause it works just fine.
<div id="form">
<select name="category" onchange="{snip ajax code here}" id="Category">
<option value=""></option>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
</div>
// when the user selects an option, <div id"form"> get's replaced with:
<div id="form">
<select name="category" onchange="{snip ajax code here}" id="Category">
<option value=""></option>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
<form id="RequestForm" enctype="multipart/form-data" method="post" action="/submit">
Input File: <input name="inputFile" value="" id="inputFile" type="file">
<input name="onDrive" id="change_form" value="1" type="checkbox"> Located on drive
</form>
<script>
$(document).ready(function(){
$('#change_form').click(function() {
if($('#change_form').is(":checked")){
// update the apply button to enabled
$('#RequestForm').removeAttr('enctype');
} else {
$('#RequestForm').attr('enctype', 'multipart/form-data');
}
});
});
</script>
</div>