Question

I am using serializeArray to send form data to a php page. When the browser (ie10) is in standards mode, it doesn't work. However, when the browser is in quirks mode it works fine. I know that means there is some html that is not standards compliant, but I don't see any problems with what I am doing. Any help would be appreciated.

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>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top