2017-09-19 18 views
0

何らかの理由で、フルカラーにピリオドを追加しようとしたときに自分のページでシリアライズしても、フォームでは機能しませんが、Internet Explorerでのみ機能します。空文字列を返します。シリアル化するための回避策がありますか?JQueryシリアル化がInternet Explorerで機能しない

JS:

function addPeriod() { 
    $.post({ 
     url: "{{ path('authorizedAbsence_period_create') }}", 
     data: $('form[name="staffbundle_absence_period"]').serialize(), 
     dataType: 'json', 
     ... 
    }); 
} 

HTML

<table> 
    <form id="staffbundle_absence_period" name="staffbundle_absence_period" method="post" action=""></form> 
    <tbody><tr class="sf_admin_form_row sf_admin_text ui-corner-all "> 
    <td><label for="staffbundle_absence_period_type">Tipo:</label></td> 
    <td> 
     <div class="content"><select id="staffbundle_absence_period_type" name="staffbundle_absence_period[type]"><option value=""></option><option value="choices.absence_type.vacation">Férias</option><option value="choices.absence_type.training">Formação</option><option value="choices.absence_type.medical">Baixa médica</option></select></div></td> 
</tr> 
    <tr class="sf_admin_form_row sf_admin_text ui-corner-all "> 
    <td><label for="staffbundle_absence_period_user">Colaborador:</label></td> 
    <td> 
     <div class="content"><select id="staffbundle_absence_period_user" name="staffbundle_absence_period[user]" style="width: 100%;"><option value=""></option><option value="25">Alberto Conde</option>...</select></div></td> 
</tr> 
<tr class="sf_admin_form_row sf_admin_text ui-corner-all "> 
    <td></td> 
    <td> 
     <div class="content"><div id="staffbundle_absence_period_start" style="display: none;"><select id="staffbundle_absence_period_start_day" name="staffbundle_absence_period[start][day]"><option value="1">01</option>...</select><select id="staffbundle_absence_period_start_month" name="staffbundle_absence_period[start][month]"><option value="1">01</option>...</select><select id="staffbundle_absence_period_start_year" name="staffbundle_absence_period[start][year]"><option value="2012">2012</option>...</select></div></div></td> 
</tr><tr class="sf_admin_form_row sf_admin_text ui-corner-all "> 
    <td></td> 
    <td> 
     <div class="content"><div id="staffbundle_absence_period_end" style="display: none;"><select id="staffbundle_absence_period_end_day" name="staffbundle_absence_period[end][day]"><option value="1">01</option>...</select><select id="staffbundle_absence_period_end_month" name="staffbundle_absence_period[end][month]"><option value="1">01</option>...</select><select id="staffbundle_absence_period_end_year" name="staffbundle_absence_period[end][year]"><option value="2012">2012</option>...</select></div></div></td> 
</tr> 
</tbody></table> 

答えて

0

私はあなたの問題はHTML自体にあるかもしれない推測している...私は<form>は、の子要素であってはならないと思います<table><tbody><tr>などですので、<form>要素を<table>から移動してみてください。

関連する問題