Welcome Guest, Not a member yet? Register   Sign In
What about elements added by jquery?
#2

[eluser]teampoop[/eluser]
So special note about the name attribute.. it's read only once it's placed in the DOM. So you may be actioning it to change the name to img1, img2, etc, but it's actually only sending img.. Use Firebug to see the post headers when you send your form to verify that.

possible solutions: attach the number when you create the image

Code:
$(function(){
    $('a.button').bind('click', function(event){
        len = $("input.image").length + 1;
        // add image label and input
        $('<label for="img" class="left">&nbsp;</label>&lt;input type="file" name="img'+ len + '" value="" id="img" class="image"  /&gt;&lt;br />').insertBefore('#last');
    });
});


Messages In This Thread
What about elements added by jquery? - by El Forum - 11-30-2010, 07:47 AM
What about elements added by jquery? - by El Forum - 11-30-2010, 11:08 AM
What about elements added by jquery? - by El Forum - 11-30-2010, 01:28 PM
What about elements added by jquery? - by El Forum - 11-30-2010, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB