This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

JqueryUpdater

By: a guest on Apr 8th, 2011  |  syntax: HTML  |  size: 1.20 KB  |  views: 132  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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>
clone this paste RAW Paste Data