Adding li containing divs to an <ol> in a form

Adding li containing divs to an <ol> in a form

I'm creating a "document library" of sorts for my car club.  The flex layout appears to be working.  I've got a jQuery add function to "add"/insert several form fields in divs to a new <li> that gets added  to the <ol> named #sortList using .append().

The new <li> with its divs and form fields appears to be created and added as desired.  However, if I submit the form the input type file array named pic doesn't appear to get submitted. 

Here's my add function:
function add() //--- add row <li> to sortList <ol> / new doc entry line
{
    tmp = "<li>\n";
    tmp += "<div class='IdCol'><input type='text' name='id[]' readonly size='3' /></div>\n";
    tmp += "<div class='CatCol'><input type='text' name='category[]' size='10' maxlength='15' /></div>\n";
    tmp += "<div class='AxsCol'><select name='access[]' size='1'><option selected</option><option value='world'>World</option><option value='hcca'>Member</option><option value='board'>Board</option></select></div>\n";
    tmp += "<div class='StatCol'><input type='text' name='stat[]' size='6' maxlength='6' /></div>\n";
    tmp += "<div class='TitleCol'><textarea name='tit[]' cols='52' rows='2'></textarea></div>\n";
    tmp += "<div class='DescripCol' style='float:left'><textarea name='txt[]' cols='75' rows='5'></textarea></div>\n";
    tmp += "<div class='FileCol' style='float:left'><input type='file' name='pic[]' size='50' /><br />\n";
    tmp += "</div>\n";
    tmp += "</li>\n";
//alert(tmp)
    $("#sortList").append(tmp);
}

And, here's the php to process the form with an echo that reports no files uploaded, but does report accurate counts of other fields:
    $ids       = $_POST['id'];
    $cats     = $_POST['category'];
    $axs      = $_POST['access'];
    $stats    = $_POST['stat'];
    $tits       = $_POST['tit'];
    $txts      = $_POST['txt'];
echo "u sub ids=".count($ids)."-cats=".count($cats)."-axs=".count($axs)."-stat=".count($stats)."-tits=".count($tits)."-txts=".count($txts). " files ".count($_FILES['pic']['name'])."<p>";

All the counts except the count of files report the correct count including any additions.  The pic array of file inputs reports zero.  Is there a problem with the add() function or what?  Here's my test page:
http://hcca.org/MemberArea/sortable4a.php

Thanks for any help
    • Topic Participants

    • brad