I spent some time reading jquery documentation and other issues. I cannot understand for life what I am doing wrong. It works for me when the page just folds and loads the page. But when I download the code through Ajax, it does not work. I read other people having similar problems, and everyone says to use .live , but this also does not work for me. What am I doing wrong?
I am trying to change the enctype form so that it does NOT load the file if the checkbox is selected.
Here is the form downloaded via ajax:
<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>
I also have this code. Should it go to the original page or can it get into content downloaded via ajax? And what do I need to do to make it work with the uploaded content, so when the change_form flag is set, will it update <form enctype> ?
<script> $(document).ready(function(){ $('#change_form').click(function() { if($('#change_form').is(":checked")){ </script>
UPDATE:. To be clear, an HTML page is loading. Then the FORM listed above is loaded via AJAX based on the user's choice. I also added a form and script to the downloaded AJAX content, so it is added to the HTML page after calling the AJAX event to load it.
Here is a little explanation with lots of code http://pastebin.com/GbWkukQu
source share