0

I have this triple combo script and when the third option is selected, it automatically redirects you. 我需要的是让它停止并通过一个按钮来执行。如果有人可以提供帮助,我将不胜感激。我试图修复它,但我是新手。不知道如何发布代码,所以如果有链接。谢谢

http://www.codingforums.com/showthread.php?t=275240

4

1 回答 1

0

查看提供的链接上的代码,第三个选项有一个“onchange”属性,它将调用“redirect2”函数。

尽管查看函数本身,但我不确定该函数是否能够进行重定向。但是,如果要禁用重定向,可以删除“onchange”属性。

如果您确实需要继续使用该功能(例如,用于更新任何状态/值),那么您需要在“onchange”属性的末尾添加 return false,例如:

onChange="redirect2(this.options.selectedIndex); return false;"

干杯:))

> (上述解决方案无效) > 编辑为:

var nextPage = "";
function redirect2(z){
//parent.chartsloader.location=temp1[z].value
//parent.location=temp1[z].value
nextPage = temp1[z].value;
}

function goToNextPage()
{
    if(document.isc.example.options.selectedIndex > 0 && document.isc.stage2.selectedIndex > 0 && document.isc.stage3.selectedIndex > 0)
        window.location = nextPage;
}
于 2012-10-06T00:21:02.187 回答