document.form.submit();不会在Safari中提交 [英] document.form.submit(); won't submit in safari
本文介绍了document.form.submit();不会在Safari中提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用JavaScript函数提交表单。这适用于除safari之外的所有浏览器,我无法弄清楚为什么
我的JavaScript函数看起来像这样
函数submitForm(){
var selectBox ='';
sel_guide_options = document.subForm.sel_guides;
if(sel_guide_options.type ==select-multiple){
for(var i = 0; i< sel_guide_options.options.length; i ++){
sel_guide_options .options [i] .selected = true;
}
}
document.subForm.submit();
}
在我的表单中,我使用这个
< input type =submitname =btnSubmitvalue =#modification_type##page_item#id =btnSubmitonclick =submitForm(); >
解决方案
尝试更改type =submit 键入=按钮。
两者都应该有效,但值得一试。
I'm using a javascript function to submit my form. This works in every browser except safari and I can't figure out why
My javascript function looks like this
function submitForm() {
var selectBox = '';
sel_guide_options = document.subForm.sel_guides;
if (sel_guide_options.type == "select-multiple") {
for (var i = 0; i <sel_guide_options.options.length; i++) {
sel_guide_options.options[i].selected = true;
}
}
document.subForm.submit();
}
and in my form I use this
<input type="submit" name="btnSubmit" value="#modification_type# #page_item#" id="btnSubmit" onclick="submitForm();">
解决方案
Try changing the form element from a type="submit" to type="button". Both should work but it's worth a try.
这篇关于document.form.submit();不会在Safari中提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文