ahh the joy of being a newbie ... I for some reason thought that the
append function was closing the form for me when in fact it was not
problem solved

        function addFormField() {
                var id = document.getElementById("id").value;

                $("#content").append("<form id='form"+ id +"' name='form"+ id 
+"'
action='#' method='POST' enctype='multipart/form-data'
onsubmit='return ajaxFileUpload("+id+");'></form>");
                $("#form"+id).append("<img id='loading' src='loading.gif'
style='display:none;'>");
                $("#form"+id).append("<input id='fileToUpload"+id+"' type='file'
size='45' name='fileToUpload' class='input'
onchange='this.form.submit.click()'>");
                $("#form"+id).append("<input type='submit'  name='submit'
value='submit' style='display: none;'' />");
                id = (id - 1) + 2;
                document.getElementById("id").value = id;
        }

On Dec 10, 2:07 pm, Mean Mike <[EMAIL PROTECTED]> wrote:
> Well here is what I have tried so far
> the first two parts that are commented out don't work in IE but the
> last one does yet they are all essentially the same thing, ultimately
> I just need to be able to read this with ease the last version doesn't
> really let me do that.
>
> here is the code
>
>         function addFormField() {
>                 var id = document.getElementById("id").value;
>                 /*
>                 $("#content").append("<form name='form" + id + "' id='form" + 
> id +
> "' action='' method='POST' enctype='multipart/form-data'
> onsubmit='return ajaxFileUpload("+id+");'>");
>                 $("#form"+id).append("<img id='loading' src='loading.gif'
> style='display:none;'>");
>                 $("#form"+id).append("<input id='fileToUpload"+id+"' 
> type='file'
> size='45' name='fileToUpload' class='input'
> onchange='this.form.submit.click()'>");
>                 $("#form"+id).append("<input type='submit'  name='submit'
> value='submit' style='display: none;'' />");
>                 */
>                 /*
>                 var  f = "<form name='form" + id + "' id='form" + id + "' 
> action=''
> method='POST' enctype='multipart/form-data' onsubmit='return
> ajaxFileUpload("+id+");'>";
>                 f+="<img id='loading' src='loading.gif' 
> style='display:none;'>";
>                 f+="<input id='fileToUpload" + id + "' type='file' size='45'
> name='fileToUpload' class='input' onchange='this.form.submit.click
> ()'>";
>                 f+="<input type='submit'  name='submit' value='submit'
> style='display: none;'' />";
>                 f+="</form>";
>                 */
>
>                 var  f = "<form name='form" + id + "' id='form" + id + "' 
> action=''
> method='POST' enctype='multipart/form-data' onsubmit='return
> ajaxFileUpload("+id+");'> <img id='loading' src='loading.gif'
> style='display:none;'> <input id='fileToUpload" + id + "' type='file'
> size='45' name='fileToUpload' class='input'
> onchange='this.form.submit.click()'> <input type='submit'
> name='submit' value='submit' style='display: none;'' /> </form>";
>
>                 $("#content").append(f);
>                 id = (id - 1) + 2;
>                 document.getElementById("id").value = id;
>         }
>
> On Dec 10, 11:22 am, Mean Mike <[EMAIL PROTECTED]> wrote:
>
> > I'm working on  a multifile upload system and I found that my form
> > function does not work in IE while I have a workaround I wonder why
> > this code doesn't work in IE  ?
>
> > thanks for your help Mike
>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
> > "http://www.w3.org/TR/html4/loose.dtd";>
> > <html>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1">
> > <title>Test jQuery</title>
> > <link href="ajaxfileupload.css" type="text/css" rel="stylesheet">
> > <script type="text/javascript" src="jquery.js"></script>
>
> > <script type="text/javascript">
> >         function addFormField() {
> >                 var id = document.getElementById("id").value;
> >                 $("#content").append("<form name='form" + id + "' id='form" 
> > + id +
> > "' action='' method='POST' enctype='multipart/form-data'
> > onsubmit='return ajaxFileUpload("+id+");'>");
> >                 $("#form"+id).append("<img id='loading' src='loading.gif'
> > style='display:none;'>");
> >                 $("#form"+id).append("<input id='fileToUpload"+id+"' 
> > type='file'
> > size='45' name='fileToUpload' class='input'
> > onchange='this.form.submit.click()'>");
> >                 $("#form"+id).append("<input type='submit'  name='submit'
> > value='submit' style='display: none;'' />");
> >                 id = (id - 1) + 2;
> >                 document.getElementById("id").value = id;
> >         }
>
> > </script>
>
> > <body>
>
> > <p><a href="#" onClick="addFormField(); return false;">Add</a></p>
> > <input type="hidden" id="id" value="1">
> > <div id="content">
>
> > </div>
>
> > </body>
> > </html>

Reply via email to