0

我正在使用 serializeArray 将表单数据发送到 php 页面。当浏览器(ie10)处于标准模式时,它不起作用。但是,当浏览器处于怪癖模式时,它可以正常工作。我知道这意味着有些 html 不符合标准,但我没有看到我正在做的任何问题。任何帮助,将不胜感激。

JavaScript

$("button.recover").on('click', function(){
    var data = $("form#editTemplate").serializeArray();
    data.push({name: 'recover', value: 1});
    console.log(data);

    $.ajax({
        type: 'POST',
        url: 'content/managed_templates/deleteTemplate.php',
        data: data,
        success: function (data){
            $("div.alerts").html(data).fadeIn().delay(1500).fadeOut();

            $("button.submit").after("<button type='button' class='delete' <?php echo $deleteRights ?> >Delete</button>");
            $("button.recover").remove();
        }
    });
});

HTML

    <form id = 'edittemplate' ENCTYPE="multipart/form-data" method = "POST" action ="content/managed_templates/savemanagedtemplate.php" >
    <ul>
        <span class='left'>
            <li>
                <label>Title</label>
                <span class='formElement'><input type='text' name='name' class='required' value = '<?php echo $template->GetDto()->GetName();?>'/></span>
            </li>
            <li>
                <label>Description</label>
                <span class='formElement'><input type='text' name='description' class='required' value = '<?php echo $template->GetDto()->GetDescription();?>' /></span>
            </li>
            <li>
                <label>Subject</label>
                <span class='formElement'><input type='text' class='required' name='templatesubject' value = '<?php echo $template->GetDto()->GetTemplatesubject();?>'/></span>
            </li>
            <li>
                <label>CVue ID</label>
                <span class='formElement'><input type='text' name='c2ktemplateid' value = '<?php echo $template->GetDto()->GetC2ktemplateid();?>'/></span>
            </li>
            <li>
                <label>Attachments</label>
                <span class='formElement'><?php echo $template->GetAttachmentField(); ?></span>
            </li>
        </span>
        <span class='right'>

            <li>
                <label>Sender</label>
                <span class='formElement'><?php echo $template->GetStaffGroupSelect($template->getDto()->GetStaffgroupid()); ?></span>
            </li>
            <li>
                <label>Default Sender</label>
                <span class='formElement'><?php echo $template->GetDefaultStaffGroupSelect($template->getDto()->GetStaffgroupdefault()); ?></span>
            </li>
            <li>
                <label>BCC</label>
                <span class='formElement'><?php echo $template->GetCarbonCopySelect($template->getDto()->GetCarboncopy()); ?></span>
            </li>
            <li>
                <label>Campus</label>
                <span class='formElement'><?php echo $template->GetCampusSelect($template->GetDto()->GetCampusid());?></span>
            </li>
            <li>
                <label>Category</label>
                <span class='formElement'><?php echo $template->GetCategorySelect($template->GetDto()->GetCategoryid());?></span>
            </li>
        </span>
        <div class='clear'></div>

    </ul>
    <div class='clear'></div>
    <h2>Template Content</h2>
    <textarea name='content' class='content tinyMCE'><?php echo $template->GetDto()->GetContent();?></textarea>
    <div class='controls'>
        <div class='buttons right'>
            <button type='button' class='submit' <?php echo $editRights['change'] ? '': 'disabled="disabled"';?> >Submit</button>
            <?php echo $deleteButton; ?>
            <!--  <button type='button' class='validate'>Validate</button>-->
            <button type='button' class='reset'>Reset</button>
            <button type='button' class='templateHelp'>Template Help</button>
        </div>
        <div class='clear'></div>
    </div>
</form>
4

0 回答 0