i have this form which is appended onclick of a div
$('#div').click(function(){
$('#div').load('form.php');
});
here is the form appended
<form id="addpic" name="addpic" method="post" enctype="multipart/form-data" action="docupload.php">
<input type="file" name="mfoni" id="upper1" style="height:10px; width:100px; cursor:hand;" />
<input type="hidden" name="user" value="<?php echo $id; ?>" id="user" />
</form>
now i want to submit the form without refreshing the page or redirecting with the code below
$("input#upper1").live('change', function(){
alert("gone");
// works up to this point
$("form#addpic").ajaxForm({
target: '#loading'
}).submit();
})
this works up to the alert('gone') point and it stops please healp me out