微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在Firefox上从Javascript提交表单

我正在创建一个javascript函数中提交的表单.我将函数绑定到select元素的onchange事件.事件在chrome和firefox中运行良好,我测试了它,它调用函数.但问题是;虽然chrome提交表单,但firefox没有.能否请你帮忙?
谢谢.

Javascript功能

function getStatementDetails()
{
    var stmtSelect = document.getElementById("statementSelect");
    var selectedId = stmtSelect.options[stmtSelect.selectedindex].value;

    var stmtForm = document.createElement("form");
    stmtForm.setAttribute('method',"post");
    stmtForm.setAttribute('action',"mymiles-mystatement");

    var stmtId = document.createElement("input");
    stmtId.setAttribute('type',"hidden");
    stmtId.setAttribute('name',"statementID");
    stmtId.setAttribute('id',"statementID");
    stmtId.setAttribute('value',selectedId);

    stmtForm.appendChild(stmtId);
    stmtForm.submit();
};

选择输入: