2014-04-02 80 views
0

嗨,我是一個HTML和JavaScript的新手。我有一些CSS樣式的水平菜單的代碼。HTML中的表單標籤和錨標籤之間的接口

<style> 
     ul 
    { 
    float:left; 
    width:100%; 
    padding:10px; 
    margin:0px; 
    list-style-type:none; 
    } 
    a.a1 
    { 
    float:left; 
    width:6em; 
    text-decoration:none; 
    color:white; 
    background-color:purple; 
    padding:0.2em 0.6em; 
    border-right:1px solid white; 
    } 
    a.a1:hover {background-color:#ff3300;} 
    li {display:inline;} 
     </style> 
    </head> 

    <body> 
    <ul> 
    <li><a class="a1" href="process.pl">Precheck</a></li> 
    <li><a class="a1" href="robostats.pl">Reboot</a></li> 
    <li><a class="a1" href="get.pl">Get</a></li> 
    <li><a class="a1" href="scen.pl">Scen</a></li> 
    <li><a class="a1" href="start.pl">start</a></li> 
    </ul> 
    The form tag is as below 
<form action="#" id=sel method="post"> 

    <input type="checkbox" name="vehicle" value="Bike">I have a bike<br> 
    <input type="checkbox" name="vehicle" value="Car">I have a car 
    </form> 

現在,當我在橫向菜單中的「預檢」點擊我想表單標籤的檢查清單和運行process.pl腳本。請幫助我如何得到這個。

+1

請清楚你的問題。這裏是你的http://jsfiddle.net/WmN5R/。我該如何幫助你呢? –

+0

@SulthanAllaudeen請運行我的代碼並立即看到 – user3095218

回答

0

你應該在你process.pl添加此代碼和文件,你需要(robostats.pl, get.pl, scan.pl).

$vehicle=$_POST['vehicle']; 
+0

是的,這是有效的。其實我會一步步執行.process.pl,robostats.pl scen.pl等。假設,如果我想執行第一個與chekboxes列表scen.pl。這將工作。我想要一個選項,並且應該爲分步和獨立工作 – user3095218

+0

是的。它會工作,然後你應該將代碼粘貼到所有需要它工作的頁面中。 –

+0

我的意思是如果複選框的輸入來自以前的perl程序,例如。 robostats.pl。我想以不同的方式運行,否則我想按照你給出的答案來運行。請幫我解決一下這個 。你有沒有帶我? – user3095218