Skip to content Skip to sidebar Skip to footer

Form.submit() Not Working In Firefox

I am using following javascript function to construct a form and submitting it to the server. It works fine in Chrome browser but not working in Firefox. function loadPage(url, pro

Solution 1:

document.body.appendChild(jForm) won't work because jForm is not a dom element, it is a jQuery object so add the below script before jForm.submit();

jForm.appendTo('body')

function loadPage(url, projectName) {
    var jForm = $('<form></form>', {
        action: url,
        method: 'post'
    });

    $("<input>", {
        name: 'curPrj',
        value: projectName
    }).appendTo(jForm);

    jForm.appendTo('body').submit();
}

Post a Comment for "Form.submit() Not Working In Firefox"