因此,我目前正在爲我校網絡管理培訓做最後一次實習。我被要求創建一個簡單的網頁,允許選擇一系列服務器來執行乾淨的安裝。喜歡:當我選擇'服務器1'和'服務器4'>點擊'提交'>確認我的動作>啓動執行乾淨安裝的VBscript。確認操作後啓動腳本(HTML)
我迄今(也指其結束代碼段): - 基本歡迎文本 - 複選框 - 全選(JavaScript)的 - Continue按鈕 - 當點擊繼續按鈕>顯示警告要求確認
我想要做的是確認後啓動所選框的腳本。那可能嗎?我的意思是,我認爲我需要別的東西而不是HTML。 Javascript可能?我會怎麼做這樣的事情?
我不是這方面的專家,根本不是。我確實有一些HTML和CSS的經驗,但Javascript和所有這一切?不,不是。很高興能有一些幫助!
<html>
<head>
<title>
Huawei Cleaning Center
</title>
<script type="text/javascript">
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
objCheckBoxes.checked = CheckValue;
else
// set the check value for all check boxes
for(var i = 0; i < countCheckBoxes; i++)
objCheckBoxes[i].checked = CheckValue;
}
</script>
<script type="text/javascript">
function clicked() {
if (confirm('Weet u zeker dat u wilt doorgaan?')) {
yourformelement.submit();
} else {
return false;
}
}
</script>
</head>
<body>
<center><h1>Welkom bij Huawei Cleaning Center!</h1></center>
<br><br>
Kruis één of meerdere van de volgende servers aan waarop u een Clean Install wilt uitvoeren:<br><br>
<form method="GET" action="page17.php" name="myForm" onsubmit="return false;">
<label for="myCheckbox1">
<input type="checkbox" name="myCheckbox" value="1" id="myCheckbox1">
172.16.115.11 </label>
<br>
<label for="myCheckbox2"><input type="checkbox" name="myCheckbox" value="2" id="myCheckbox2">
172.16.115.21 </label>
<br>
<label for="myCheckbox3"><input type="checkbox" name="myCheckbox" value="3" id="myCheckbox3">
172.16.115.31 </label>
<br>
<label for="myCheckbox4"><input type="checkbox" name="myCheckbox" value="4" id="myCheckbox4">
172.16.115.41 </label>
<br><br><input type="submit" id="submit1" onclick="clicked();" value="Doorgaan">
<input type="button" onclick="SetAllCheckBoxes('myForm', 'myCheckbox', true);" value="Selecteer alles">
<input type="button" onclick="SetAllCheckBoxes('myForm', 'myCheckbox', false);" value="Deselecteer alles">
</form>
</body>
</html>
請包括到目前爲止你寫的代碼。您提供的細節越多,您可能收到的答案就越多。檢查[FAQ](http://stackoverflow.com/tour)和[如何提問](http://stackoverflow.com/help/how-to-ask)。 –
確認()後,您可以重定向到特定的VBscript啓動頁面:window.location.replace(「your-page」); – Ruby