Hello all, I'm attempting to submit a form I've created out of an html string, like this:
var upload_form = "`<form action=\"uploadSong.php\" method=\"POST\" class=\"upload_form\" enctype = \"multipart/form-data\" target=\"upload_form\">`";
upload_form += "<input type=\"hidden\" name=\"showId\" value=\"" + showId + "\" />";
upload_form += "<input type=\"hidden\" name=\"band_abb\" value=\"" + band_abb + "\" />";
upload_form += "<input type=\"hidden\" name=\"showDate\" value=\"" + date + "\" />";
upload_form += "<input type=\"hidden\" name=\"city\" value=\"" + city + "\" />";
upload_form += "<input type=\"hidden\" name=\"state\" value=\"" + state + "\" />";
upload_form += "<input type=\"hidden\" name=\"venue\" value=\"" + venue + "\" />";
upload_form += "<input type=\"hidden\" name=\"setNum\" value=\"" + setNum + "\" />";
upload_form += "<input type=\"hidden\" name=\"songNum\" value=\"" + songNum + "\" />";
upload_form += "<input type=\"hidden\" name=\"songId\" value=\"" + songId + "\" />";
upload_form += "<input type=\"hidden\" name=\"showId\" value=\"" + showId + "\" />";
upload_form += "<input type=\"hidden\" name=\"songName\" value=\"" + songName + "\" />";
upload_form += "<input type=\"file\" name=\"upload[]\" value=\"" + songLoc + "\" />";
upload_form += "<input type=\"hidden\" name=\"partOfASegue\" value=\"" + partOfASeuge + "\" />";
upload_form += "<input type=\"hidden\" name=\"addInfo\" value=\"" + addInfo + "\" />";
upload_form += "<input type=\"submit\" name=\"submit_btn\" value=\"submited\" />";
upload_form += "</form>";
$('#upload_form').html(upload_form);
alert(upload_form);
$('form .upload_form').submit();
$('form .upload_form').remove();
And I have a target for the html like this:
`<iframe id="upload_form"></iframe>
I'm trying to repetitively upload a series of files, Does anyone see why this wouldn't work?