JavaScript在单击文本时不提交隐藏表单 [英] JavaScript not submitting hidden form when clicking text

查看:102
本文介绍了JavaScript在单击文本时不提交隐藏表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚问了一个类似这样的问题,但只是一个小例子。然而,该代码的问题与我目前的代码不一样。 (如果您的好奇是我以前的问题: JavaScript文本不提交表单) p>

我正在处理我的第一个Web应用程序,并试图使用JavaScript通过单击文本来提交表单。当我点击文字时,什么都没有发生。现在应该打开一个简单的网页。我知道如何使用html处理表单,但是当我尝试使用JavaScript时,什么也没有发生。我正在使用unix,并且我已经配置了我的服务器和chmod 755 cgi文件。我不是这是一个服务器错误,因为我之前已经执行了它的cgi文件。



点击数字应该提交隐藏的表单并打开更详细的报表。我有一长串隐藏字段,因为我将数组传递给cgi文件。目前,cgi文件只是链接到一个简单的测试文件,因为当我点击链接时,cgi文件甚至没有运行。



以下是html代码:

 < html> 
< head>
< title>核心报告< / title>
< script language =JavaScripttype =text / javascript>


函数getDetails(selectedField)<! - 告诉打印哪个列表 - >
{
document.details.resultsToPrint.value = selectedField;
document.details.submit();


}



< / script>
< style>
#title {
text-align:center;
}
表格{
margin-left:auto;
margin-right:auto;
text-align:center;
border:2px纯黑色;
border-collapse:collapse;
宽度:30%;

}
.corner {background-color:red;}#Corner4 {background-color:#7CFC00;}
< / style>
< / head>
< body>
< h1 id ='title'>核心报告< / h1>

< table>
< tbody>
< tr>
< th>< / th>
< th>< font size ='5'>通过次数< / font>< / th>
< th>< font size ='5'>失败数量< / font>< / th>
< / tr>< tr id ='Corner1'class ='corner'>< td>< font size ='6'>角落1< / font>< / td>< td>< a href ='javascript:getDetails(Corner1Passes)'>< font size ='6'> 201< / font>< / a>< / td>< td>< a href ='javascript:getDetails(Corner1Failures)'>< font size ='6'> 18< / font>< / a>< / td>< / tr>
< tr id ='Corner2'class ='corner'>< td>< font size ='6'>角落2< / font>< / td>< td>< a href ='javascript:getDetails(Corner2Passes)'>< font size ='6'> 2< / font>< / a>< / td>< td>< a href ='javascript:getDetails(Corner2Failures)'>< font size ='6'> 2< / font>< / a>< / td>< / tr>
< tr id ='Corner3'class ='corner'>< td>< font size ='6'>角落3< / font>< / td>< td>< a href ='javascript:getDetails(Corner3Passes)'>< font size ='6'> 2< / font>< / a>< / td>< td>< a href ='javascript:getDetails(Corner3Failures)'>< font size ='6'> 2< / font>< / a>< / td>< / tr>
< tr id ='Corner4'class ='corner'>< td>< font size ='6'>角落4< / font>< / td>< td>< a href ='javascript:getDetails(Corner4Passes)'>< font size ='6'> 4< / font>< / a>< / td>< td>< a href ='javascript:getDetails(Corner4Failures)'>< font size ='6'> 0< / font>< / a>< / td>< / tr>
< / tbody>< / table>
< form name ='details'method ='post'action ='/ cgi-bin / hello.py'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / marginVoltage --margin high'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / verifyVoltage --margin high'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 1 / testFanDirection'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 1 / testFanPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 1 / fan / testFanSpeed --station edvt'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 2 / testFanDirection'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 2 / testFanPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 2 / fan / testFanSpeed --station edvt'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 3 / testFanDirection'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 3 / testFanPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 3 / fan / testFanSpeed --station edvt'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 4 / testFanDirection'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 4 / testFanPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ fanChassis / 4 / fan / testFanSpeed --station edvt'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testChecksums'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testPmbusRevision'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testPowerState --expectedState on'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testRevision'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / testStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 1 / verifyModel'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testChecksums'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testPmbusRevision'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testPowerState --expectedState on'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testRevision'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / testStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ powerSupplies / 2 / verifyModel'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testMaxOutputPower --maxOutputPower 320'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testPowerLoadSharing'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// verifyPsuFansCranked'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// verifyPsuFansCranked'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testACPowerSupplyOffStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testPowerGood'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// verifyPsuFansCranked'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testACPowerSupplyOffStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testPowerGood'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// verifyPsuFansCranked'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// verifyPsuFansCranked'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / testMicrocodeVersion'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / testTemperature'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testPresence --pattern SFT00'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testRegister --rail None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / mathFPTest --duration 30 --stopOnError True --verbose True'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / imcTest --duration 30 --verbose True --percentage 50'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / mathPrimeNumTest --duration 30 --stopOnError True --verbose True'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / testUSBDevices'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / sdram / testDDR --reset False --iterations 0 --duration 30 --blockSize 8000000 --memctl mc0' >
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpld / testScratchRegister'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpld / checkFanHealth'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpld / testRevision'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / usbFlash / testSize'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / sdram / checkeccTestmem --blockSize 16000000 --iterations 10000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / sdram / 0 / spdseeprom / testMemory'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / sdram / 0 / spdseeprom / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testDeviceId'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testLoggedFaults'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / testMarginAndReadVoltage'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / ucd / verifyVoltageStability --rail None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / tempsensor / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / tempsensor / testRegister'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / avxTest --verbose True'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / cpuLoadTest --duration 2 --core 8 --verbose True'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / mmxSseTest --verbose True'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / powerLoadTest --duration 60 --timeLow 1 --timeHigh 1'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 1 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 1 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 1 / testIdentification --vendorId None --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 1 / testPcieReadWrite --deviceVendorId 0 - 资源无--useConfigSpace无--expectedValue 0 - 寄存器0 - 测试类型0 - 时间1000000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 2 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 2 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 2 / testIdentification --vendorId None --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 2 / testPcieReadWrite --deviceVendorId 0 - 资源无--useConfigSpace无--expectedValue 0 - 寄存器0 - 测试类型0 - 时间1000000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 3 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 3 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 3 / testIdentification --vendorId None --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 3 / testPcieReadWrite --deviceVendorId 0 - 资源无--useConfigSpace无--expectedValue 0 - 寄存器0 - 测试类型0 - 时间1000000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 4 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 4 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 4 / testIdentification --vendorId None --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 4 / testPcieReadWrite --deviceVendorId 0 - 资源无--useConfigSpace无--expectedValue 0 - 寄存器0 - 测试类型0 - 时间1000000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 5 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 5 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 5 / testIdentification --vendorId None --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / cpu / rootComplex / ports / 5 / testPcieReadWrite --deviceVendorId 0 - 资源无--useConfigSpace无--expectedValue 0 - 寄存器0 - 测试类型0 - 时间1000000'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ cpuCard / fanLeds / testBasic'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testLoopbackPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:// testTempSensor'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / sol / testReadM2InfoAndSwVersion'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / testTemperature'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / testComponents'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / max6697 / testPollTemperature'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / prefdl / testMemory'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testDeviceId'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testLoggedFaults'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testPresence --pattern SFT002910'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testRegister --rail None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testRevision --revision SFT002910102'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / testStatus'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ucd / verifyVoltage --rail None --margin nominal'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / testDeviceId'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / testMarginAndReadVoltage'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / testPresence --mfgId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / testRegister'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / testVoltageMargining'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir1 / verifyVoltage --rail None --margin nominal'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir2 / testDeviceId'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir2 / testMarginAndReadVoltage'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir2 / testPresence --mfgId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir2 / testRegister'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / testDeviceId'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / testMarginAndReadVoltage'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / testPresence --mfgId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / testRegister'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / testVoltageMargining'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / ir3 / verifyVoltage --rail None --margin nominal'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 0 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 0 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 0 / testClearErrors'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 0 / testIdentification --vendorId 4277 --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 0 / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 1 / testAudit'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 1 / testAuditPath'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 1 / testClearErrors'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 1 / testIdentification --vendorId 4277 --deviceId None'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / pcieSwitch / ports / 1 / testPresence'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 1 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 1 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 2 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 2 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 3 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 3 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 4 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 4 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 5 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 5 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 6 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 6 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 7 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 7 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 8 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 8 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 9 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 9 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 10 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 10 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 11 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 11 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 12 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 12 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 13 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 13 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 14 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 14 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 15 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 15 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 16 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 16 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 17 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 17 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 18 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 18 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 19 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 19 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 20 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 20 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 21 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 21 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 22 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 22 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 23 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 23 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 24 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 24 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 25 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 25 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 26 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 26 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 27 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 27 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 28 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 28 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 29 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 29 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 30 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 30 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 31 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 31 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 32 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 32 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 33 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 33 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 34 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 34 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 35 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 35 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 36 / testAll'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / xcvrs / 36 / testLowSpeedSignals'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / portsLeds / testBasic'>
< input type ='hidden'name ='Corner1Passes'value ='TEST PASS:/ switchCard / boardLeds / testBasic'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / verifyVoltage --margin high'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ cpuCard / sdram / memVerify --ddrTypeExp DDR3 --memSizeMBExp 4096 --dimmsExp 1 --spdAddrsExp [[81]] - -ignorecompare False --verbose False'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:// testVoltageMargining'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / sol / testAuthM --kgfile None'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / pcieSwitch / lanes / 0 / testLoopback'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / pcieSwitch / lanes / 1 / testLoopback'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / pcieSwitch / lanes / 2 / testLoopback'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / pcieSwitch / lanes / 3 / testLoopback'>
< input type ='hidden'name ='Corner1Failures'value ='TEST FAIL:/ switchCard / pcieSwitch / lanes / 4 / testLoopback'>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/pcieSwitch/lanes/5/testLoopback’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/pcieSwitch/lanes/6/testLoopback’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/pcieSwitch/lanes/7/testLoopback’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/xcvrs/1/testTunableLaser’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/xcvrs/2/testTunableLaser’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/xcvrs/3/testTunableLaser’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/xcvrs/4/testTunableLaser’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/idproms/1/testMemory’>
<input type= ’hidden’ name=’Corner1Failures’ value=’TEST FAIL: /switchCard/idproms/2/testMemory’>
<input type= ’hidden’ name=’Corner2Passes’ value=’TEST PASS hello’>
<input type= ’hidden’ name=’Corner2Passes’ value=’TEST PASS world’>
<input type= ’hidden’ name=’Corner2Failures’ value=’TEST FAIL hello’>
<input type= ’hidden’ name=’Corner2Failures’ value=’TEST FAIL world’>
<input type= ’hidden’ name=’Corner3Passes’ value=’TEST PASS howdy’>
<input type= ’hidden’ name=’Corner3Passes’ value=’TEST PASS world’>
<input type= ’hidden’ name=’Corner3Failures’ value=’TEST FAIL howdy’>
<input type= ’hidden’ name=’Corner3Failures’ value=’TEST FAIL world’>
<input type= ’hidden’ name=’Corner4Passes’ value=’TEST PASS I’>
<input type= ’hidden’ name=’Corner4Passes’ value=’TEST PASS am’>
<input type= ’hidden’ name=’Corner4Passes’ value=’TEST PASS William’>
<input type= ’hidden’ name=’Corner4Passes’ value=’TEST PASS Song’>
<input type = ’hidden’ name = ’resultsToPrint’ >
< / form>
< / body>< / html>

Here is the test cgi file:

#!/usr/bin/python 

import cgitb, cgi
cgitb.enable()

print \"Content-type:text/html\r\n\r\n\"
print ’<html>’
print ’<head>’
print ’<title>Hello Word - First CGI Program</title>’
print ’</head>’
print ’<body>’
print ’<h2>Hello Word! This is my first CGI program</h2>’
print ’</body>’
print ’</html>’

I have been trying to figure out what is wrong for hours. I am a beginner when it comes to javascript so any help will be greatly appreciated!

解决方案

When you pass a value that is a string in JavaScript you will need to quote it properly or JavaScript will think you mean a variable with that name.



e.g.

<a href = ’javascript:getDetails(Corner2Passes)’><font size=’6’> 2 </font></a> 

should be:

<a href=\"javascript:getDetails(’Corner2Passes’);\"><font size=’6’> 2 </font></a> 

A few non-essential notes:




  • I would recommend always using the double quotes on HTML attributes for consistency/readability

  • There’s no need for spaces around the = character between attribute names and values

  • The <font> tag was deprecated years ago, I’d recommend using the <span> tag instead, and although you could set the font size via a style attribute, if you add a class attribute you can style all elements you want the same way with one declaration

  • you will want to add a <!doctype html> tag before the <html> tag to ensure your pages are rendering in standards mode (much pain to come, esp. in older IE versions if you don’t)

  • you don’t need the lang or type attributes in your <script> tag, by default it is taken as JavaScript


I just asked a question similar to this but with a smaller example. However the issue with that code is not the same with my current code. (If your curious here is my previous question: JavaScript Text not submitting form)

I am working on my first web application and I am trying to use javascript to submit a form by clicking on text. When I click on the text nothing happens. It should just open to a simple webpage for now. I know how to process forms with html, but when I try and use javascript nothing happens. I am using unix and i have already configured my server and chmod 755 the cgi file. I not it is not a server error as I have executed cgi files on it before.

Clicking on the numbers should submit the hidden forms and open a more detailed repot. I have a long list of hidden fields because I am passing on arrays to the the cgi file. Currently the cgi file is just linked to a simple test file because when I click the link the cgi file is not even running.

Here is the html code:

<html>
            <head>
                <title>Core Report</title>
                <script language="JavaScript" type="text/javascript">


                        function getDetails (selectedField) <!--tell which list to print-->
                        {
                            document.details.resultsToPrint.value = selectedField;
                            document.details.submit();


                        }



                </script>
                <style>
                    #title {
                        text-align:center;
                    }
                    table {
                        margin-left:auto; 
                        margin-right:auto;
                        text-align:center;
                        border: 2px solid black;
                        border-collapse: collapse;
                        width:30%;

                    }
                    .corner {background-color: red;} #Corner4{background-color: #7CFC00;}
                </style>
            </head>
            <body>
                <h1 id = 'title'>Core Report</h1>

    <table>
        <tbody>
            <tr>
                <th></th>
                <th><font size='5'># of Passes</font></th>
                <th><font size='5'># of Failures</font></th>
            </tr><tr id = 'Corner1' class = 'corner'><td><font size='6'> Corner 1 </font></td><td><a href = 'javascript:getDetails(Corner1Passes)'><font size='6'> 201 </font></a></td><td><a href = 'javascript:getDetails(Corner1Failures)'><font size='6'> 18 </font></a></td></tr>
<tr id = 'Corner2' class = 'corner'><td><font size='6'> Corner 2 </font></td><td><a href = 'javascript:getDetails(Corner2Passes)'><font size='6'> 2 </font></a></td><td><a href = 'javascript:getDetails(Corner2Failures)'><font size='6'> 2 </font></a></td></tr>
<tr id = 'Corner3' class = 'corner'><td><font size='6'> Corner 3 </font></td><td><a href = 'javascript:getDetails(Corner3Passes)'><font size='6'> 2 </font></a></td><td><a href = 'javascript:getDetails(Corner3Failures)'><font size='6'> 2 </font></a></td></tr>
<tr id = 'Corner4' class = 'corner'><td><font size='6'> Corner 4 </font></td><td><a href = 'javascript:getDetails(Corner4Passes)'><font size='6'> 4 </font></a></td><td><a href = 'javascript:getDetails(Corner4Failures)'><font size='6'> 0 </font></a></td></tr>
</tbody></table>
<form name='details' method='post' action='/cgi-bin/hello.py'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/marginVoltage --margin high'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/verifyVoltage --margin high'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testChecksums'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPmbusRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPowerState --expectedState on'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/verifyModel'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testChecksums'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPmbusRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPowerState --expectedState on'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/verifyModel'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testMaxOutputPower --maxOutputPower 320'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerLoadSharing'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testACPowerSupplyOffStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerGood'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testACPowerSupplyOffStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerGood'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testMicrocodeVersion'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testPresence --pattern SFT00'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testRegister --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mathFPTest --duration 30 --stopOnError True --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/imcTest --duration 30 --verbose True --percentage 50'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mathPrimeNumTest --duration 30 --stopOnError True --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testUSBDevices'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/testDDR --reset False --iterations 0 --duration 30 --blockSize 8000000 --memctl mc0'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/testScratchRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/checkFanHealth'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/usbFlash/testSize'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/checkeccTestmem --blockSize 16000000 --iterations 10000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/0/spdseeprom/testMemory'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/0/spdseeprom/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testLoggedFaults'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/verifyVoltageStability --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/tempsensor/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/tempsensor/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/avxTest --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/cpuLoadTest --duration 2 --core 8 --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mmxSseTest --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/powerLoadTest --duration 60 --timeLow 1 --timeHigh 1'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/fanLeds/testBasic'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testLoopbackPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testTempSensor'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/sol/testReadM2InfoAndSwVersion'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/testTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/testComponents'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/max6697/testPollTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/prefdl/testMemory'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testLoggedFaults'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testPresence --pattern SFT002910'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testRegister --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testRevision --revision SFT002910102'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testVoltageMargining'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testVoltageMargining'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testClearErrors'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testIdentification --vendorId 4277 --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testClearErrors'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testIdentification --vendorId 4277 --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/1/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/1/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/2/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/2/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/3/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/3/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/4/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/4/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/5/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/5/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/6/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/6/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/7/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/7/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/8/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/8/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/9/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/9/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/10/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/10/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/11/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/11/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/12/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/12/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/13/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/13/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/14/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/14/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/15/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/15/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/16/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/16/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/17/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/17/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/18/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/18/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/19/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/19/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/20/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/20/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/21/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/21/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/22/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/22/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/23/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/23/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/24/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/24/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/25/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/25/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/26/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/26/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/27/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/27/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/28/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/28/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/29/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/29/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/30/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/30/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/31/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/31/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/32/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/32/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/33/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/33/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/34/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/34/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/35/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/35/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/36/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/36/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/portsLeds/testBasic'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/boardLeds/testBasic'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/verifyVoltage --margin high'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /cpuCard/sdram/memVerify --ddrTypeExp DDR3 --memSizeMBExp 4096 --dimmsExp 1 --spdAddrsExp [[81]] --ignorecompare False --verbose False'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: //testVoltageMargining'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/sol/testAuthM --kgfile None'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/0/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/1/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/2/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/3/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/4/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/5/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/6/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/7/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/1/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/2/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/3/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/4/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/idproms/1/testMemory'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/idproms/2/testMemory'>
<input type= 'hidden' name='Corner2Passes' value='TEST PASS hello'>
<input type= 'hidden' name='Corner2Passes' value='TEST PASS world'>
<input type= 'hidden' name='Corner2Failures' value='TEST FAIL hello'>
<input type= 'hidden' name='Corner2Failures' value='TEST FAIL world'>
<input type= 'hidden' name='Corner3Passes' value='TEST PASS howdy'>
<input type= 'hidden' name='Corner3Passes' value='TEST PASS world'>
<input type= 'hidden' name='Corner3Failures' value='TEST FAIL howdy'>
<input type= 'hidden' name='Corner3Failures' value='TEST FAIL world'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS I'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS am'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS William'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS Song'>
<input type = 'hidden' name = 'resultsToPrint' > 
</form> 
</body></html>

Here is the test cgi file:

#!/usr/bin/python

import cgitb, cgi
cgitb.enable()

print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'

I have been trying to figure out what is wrong for hours. I am a beginner when it comes to javascript so any help will be greatly appreciated!

解决方案

When you pass a value that is a string in JavaScript you will need to quote it properly or JavaScript will think you mean a variable with that name.

e.g.

<a href = 'javascript:getDetails(Corner2Passes)'><font size='6'> 2 </font></a>

should be:

<a href="javascript:getDetails('Corner2Passes');"><font size='6'> 2 </font></a>

A few non-essential notes:

  • I would recommend always using the double quotes on HTML attributes for consistency/readability
  • There's no need for spaces around the = character between attribute names and values
  • The <font> tag was deprecated years ago, I'd recommend using the <span> tag instead, and although you could set the font size via a style attribute, if you add a class attribute you can style all elements you want the same way with one declaration
  • you will want to add a <!doctype html> tag before the <html> tag to ensure your pages are rendering in standards mode (much pain to come, esp. in older IE versions if you don't)
  • you don't need the lang or type attributes in your <script> tag, by default it is taken as JavaScript

这篇关于JavaScript在单击文本时不提交隐藏表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆