简体   繁体   English

单击文本时JavaScript不提交隐藏表单

[英]JavaScript not submitting hidden form when clicking text

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 ) (如果您对此感到好奇是我以前的问题: JavaScript文本未提交表单

I am working on my first web application and I am trying to use javascript to submit a form by clicking on text. 我正在开发我的第一个Web应用程序,并且尝试使用javascript通过单击文本来提交表单。 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. 我知道如何使用html处理表单,但是当我尝试使用javascript时却什么也没发生。 I am using unix and i have already configured my server and chmod 755 the cgi file. 我正在使用unix,并且已经配置了服务器和chmod 755 cgi文件。 I not it is not a server error as I have executed cgi files on it before. 我不是那不是服务器错误,因为我之前已经在上面执行过cgi文件。

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. 我有很长的隐藏字段列表,因为我正在将数组传递给cgi文件。 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. 当前,cgi文件只是链接到一个简单的测试文件,因为当我单击链接时,cgi文件甚至没有运行。

Here is the html code: 这是html代码:

<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: 这是测试cgi文件:

#!/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! 我是JavaScript的初学者,因此对您的帮助将不胜感激!

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. 当您传递的值是JavaScript中的字符串时,您需要正确地对其进行引用,否则JavaScript会认为您的意思是具有该名称的变量。

eg 例如

<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 我建议始终在HTML属性上使用双引号,以确保一致性/可读性
  • 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 <font>标签在几年前已过时,我建议改为使用<span>标签,尽管您可以通过style属性设置字体大小,但是如果添加class属性,则可以为所有需要相同样式的元素设置样式一个声明的方式
  • 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) 你将要添加一个<!doctype html>的标记之前<html>标签,以确保您的网页在标准模式渲染(多苦来,尤指在老年人IE版本,如果你不这样做)
  • you don't need the lang or type attributes in your <script> tag, by default it is taken as JavaScript 您不需要<script>标记中的lang或type属性,默认情况下它被视为JavaScript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM