0

我们有这种适用于 PC 上的 FF、Chrome 和 IE 的表单。

在带有 Firefox 的 Mac 上,它不会向下一页发布任何值。发布到的页面没有收到表单输入值...

我查不出有什么问题...

非常感谢任何帮助,因为我要发疯了 ;-) 谢谢,巴斯

<form name="f2" action="index.php?option=com_content&amp;task=view&amp;id=62&amp;Itemid=76" method="post" onsubmit="return checkMeasures(this)">

Javascript:

function checkMeasures(form) 
{

    var elem = form.elements;
    var distances_array = new Array();
    var variables_array = new Array();
    var chosen_pool_shape = 0;
    var compare_with_index = 0;

    for(i=0; i<elem.length; i++)
    {
        if (elem[i].name.indexOf("-") != -1)
        {
            distances_array[i] = parseInt(elem[i].value);
            variables_array[i] = elem[i].name;
        }
        else
        {
            if (elem[i].name == "chosen_pool_shape")
            {
                chosen_pool_shape = elem[i].value;
            }
        }
    }

    var half_array = distances_array.length/2;

    for(index=0; index<half_array; index++)
    {
        var count = index;
        compare_with_index = half_array+count;
        if(distances_array[index] == 0)
        {
            alert('De maten van het winterzeil zijn niet compleet.');
            return false;
        }else if(distances_array[compare_with_index] == 0)
        {
            alert('De maten van het zwembad zijn niet compleet.');
            return false;
        }else{
            if ((distances_array[index] < 20) || (distances_array[compare_with_index] < 20))
            {
                alert('Gelieve centimeters in te vullen in plaats van meters! Verander het winterzeil / Zwembadametingen < 100.');
                return false;
            }
            if ((variables_array[index] != "C-E") && (variables_array[index] != "F-D"))
            {
                if (distances_array[index] <= distances_array[compare_with_index])
                {
                    //document.write(distances_array[index] + distances_array[compare_with_index]);
                    alert('Fout: Het winterzeil moet groter zijn dan het zwembad. Gelieve uw afstand(en) aan te passen zodat het zeil over het zwembad hangt.');
                    return false;
                }
            }
        }
    }

    return true;
}
4

1 回答 1

1

太疯狂了,它失踪了;我忽略了...

onsubmit="return checkMeasures(this)"

不工作...

onsubmit="return checkMeasures(this);"

行得通!

终于找到了:-)

于 2013-10-09T20:37:42.497 回答