选择“加载ajax后未正确显示”选项


select option not displaying correctly after .load ajax

我正在使用以下代码将一个php页面加载到一个特殊的div中

function peopleEdit(id, currid) {

       $("#people_edit").load( "people_edit.php?id="+currid );

return false;
}

不过有两个问题。

  1. 显示的表单中,选择框中有选项值,并且该选项不起作用。

  2. 显示tinymce框,但数据不在框内。

在ajax加载之前,表单已经过测试并且工作正常

这是表单的html。

<form action="people.php" enctype="multipart/form-data" name="pelatesForm" id="pelatesForm" method="post">
    <table width="90%" border="0" cellspacing="0" cellpadding="6">
          <tr>
        <td width="20%" align="right">Τύπος</td>
        <td width="80%"><label>
          <select name="pelates_type_det" id="pelates_type_det" />
          <option value="<?php echo $pelates_det_type ?>"><?php echo $pelates_det_type ?></option>
          <option value="Πελάτης">Πελάτης</option>
          <option value="Προμηθευτής">Προμηθευτής</option>
          </select>
        </label></td>
      </tr>
              <tr>
        <td width="20%" align="right">Όνομα</td>
        <td width="80%"><label>
          <input name="pelates_first_name_det" type="text" id="pelates_first_name_det" size="64" value="<?php echo $pelates_det_first_name ?>" />
        </label></td>
      </tr>
                    <tr>
        <td width="20%" align="right">Επίθετο</td>
        <td width="80%"><label>
          <input name="pelates_last_name" type="text" id="pelates_last_name" size="64" value="<?php echo $pelates_det_last_name ?>" />
        </label></td>
      </tr>
          <tr>
        <td width="20%" align="right">Τηλέφωνο - Σταθερό</td>
        <td width="80%"><label>
          <input name="pelates_phone" type="text" id="pelates_phone" size="64" value="<?php echo $pelates_det_phone ?>" />
        </label></td>
      </tr>
                <tr>
        <td width="20%" align="right">Τηλέφωνο - Κινητό</td>
        <td width="80%"><label>
          <input name="pelates_cell" type="text" id="pelates_cell" size="64" value="<?php echo $pelates_det_cell ?>" />
        </label></td>
      </tr>
                      <tr>
        <td width="20%" align="right">Email</td>
        <td width="80%"><label>
          <input name="pelates_email" type="text" id="pelates_email" size="64" value="<?php echo $pelates_det_email ?>" />
        </label></td>
      </tr>
                            <tr>
        <td width="20%" align="right">Όνομα εταιρείας - Ιδιώτης</td>
        <td width="80%"><label>  
        <input name="pelates_company" id="pelates_company" size="64" value="<?php echo $pelates_det_company ?>" />
        </label>
        </td>
      </tr>
                                  <tr>
        <td width="20%" align="right">ΑΦΜ</td>
        <td width="80%"><label>
          <input name="pelates_afm" type="text" id="pelates_afm" size="64" value="<?php echo $pelates_det_afm ?>" />
        </label></td>
      </tr>
         <tr>
        <td width="20%" align="right">ΔΟΥ</td>
        <td width="80%"><label>
          <input name="pelates_doy" type="text" id="pelates_doy" size="64" value="<?php echo $pelates_det_doy ?>" />
        </label></td>
      </tr>
                            <tr>
        <td width="20%" align="right">Διεύθυνση</td>
        <td width="80%"><label>
          <input name="pelates_address" type="text" id="pelates_address" size="64" value="<?php echo $pelates_det_address ?>" />
        </label></td>
      </tr>
                            <tr>
        <td width="20%" align="right">Ταχυδρομικός κώδικας</td>
        <td width="80%"><label>
          <input name="pelates_tk" type="text" id="pelates_tk" size="64" value="<?php echo $pelates_det_tk ?>" />
        </label></td>
      </tr>
                                  <tr>
        <td width="20%" align="right">Περιοχή</td>
        <td width="80%"><label>
          <input name="pelates_area" type="text" id="pelates_area" size="64" value="<?php echo $pelates_det_area ?>" />
        </label></td>
      </tr>
          <tr>
        <td width="20%" align="right">Σχόλια</td>
        <td width="80%">
          <textarea name="pelates_comments_det" type="text" class="tinymce" id="pelates_comments_det" size="64" /><?php echo $pelates_det_comments ?></textarea>
        </td>
      </tr>
          <tr>
        <td>&nbsp;</td>
        <td><label>
        <input name="thisID" type="hidden" value="<?php echo $targetID ?>" />
          <input type="submit" name="submitpel" id="submitpel" value="Υποβολή" /> 
          <input type="button" value="Άκυρο"  onclick="return epistrofi('people_detailed','<?php echo $targetID ?>');" />
        </label>
        </td>
      </tr>
    </table>
</form>

你知道为什么会发生这种事吗?

关闭select:

<select name="pelates_type_det" id="pelates_type_det" />

更改为:

<select name="pelates_type_det" id="pelates_type_det">