Advertisement
Guest User

JqueryUpdater

a guest
Apr 8th, 2011
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.20 KB | None | 0 0
  1. // this is the ajax loading mechanism, I sniped the ajax code cause it works just fine.
  2. <div id="form">
  3.   <select name="category" onchange="{snip ajax code here}" id="Category">
  4.   <option value=""></option>
  5.   <option value="option1">Option 1</option>
  6.   <option value="option2">Option 2</option>
  7. </select>
  8. </div>
  9.  
  10. // when the user selects an option, <div id"form"> get's replaced with:
  11. <div id="form">
  12.   <select name="category" onchange="{snip ajax code here}" id="Category">
  13.   <option value=""></option>
  14.   <option value="option1">Option 1</option>
  15.   <option value="option2">Option 2</option>
  16. </select>
  17. <form id="RequestForm" enctype="multipart/form-data" method="post" action="/submit">
  18. Input File: <input name="inputFile" value="" id="inputFile" type="file">
  19. <input name="onDrive" id="change_form" value="1" type="checkbox"> Located on drive
  20. </form>
  21. <script>
  22. $(document).ready(function(){
  23.     $('#change_form').click(function() {
  24.     if($('#change_form').is(":checked")){
  25.         // update the apply button to enabled
  26.         $('#RequestForm').removeAttr('enctype');
  27.     } else {
  28.         $('#RequestForm').attr('enctype', 'multipart/form-data');  
  29.     }
  30.     });
  31. });
  32. </script>
  33. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement