我一直在使用表单中的下拉菜单,并对数据进行拆分和显示。 仅给出了1个数据点,并在其上显示统计信息,这就是我要放置URL的地方。
但是,我想做同样的事情,但要使用URL链接。
我的下拉列表将是邻居,然后数据将被分成多个框。
<form id="form1" name="form1" method="post" action="none" >
<table width="96%">
<tr>
<th colspan="4"> <input type="hidden" name="base" id="base" value="System 1">
<h1>Neighbourhood Crime Links</h1>
</th>
</tr>
<tr>
<td class="calc_dropbox" colspan="2">Select Option</td>
<td class="calc_dropbox" colspan="2"> <select name="starterkit" id="starterkit" class="dropdown" onChange="calc(1);">
<option value="0|Please Select|||||||start">Please Select Option</option>
<option value="1|2|stats|stats1|stats2|stats4|stats5|neighbourhood">option1</option>
</select> </td>
</tr>
<tr id="kit" class="kit" style="display:">
<th class="Panel" colspan="1">Neighbourhood:</th>
<th class="Panelname" colspan="2"><span id ="Neighbourhood"></span></th>
<th class="Panelprice" colspan="1"><span id="Neighbourhood1"></span></th>
</tr>
<tr id="kit" class="kit" style="display:">
<td class="items">Link 1:</td>
<td class="items2"><span id ="Neighbourhood2"></span></td>
<td class="items">Link 2:</td>
<td class="items2"><span id ="Neighbourhood3"></span></td>
</tr>
<tr id="kit" class="kit" style="display:">
<td class="items">Link 3:</td>
<td class="items2"><span id ="Neighbourhood4"></span></td>
<td class="items">Link 4:</td>
<td class="items2"><span id ="Neighbourhood5"></span></td>
</tr>
<tr id="kit" class="kit" style="display:">
<td class="items">Link 5:</td>
<td class="items2"><span id ="Neighbourhood6"></span></td>
<td class="items">Link 6:</td>
<td class="items2"><span id ="Neighbourhood7"></span></td>
</tr>
<tr>
<td>
<!-- <input type="submit" name="Submit" value="Order Now" /> -->
</td>
</tr>
</table>
</form>
//java:-
calc = function (e) {
var t = document.getElementById ("starterkit").value.split("|");
n += t[0] * 1;
document.getElementById("Neighbourhood").innerHTML = "" + t[0];
document.getElementById("Neighbourhood1").innerHTML = "" + t[0];
document.getElementById("Neighbourhood2").innerHTML = "" + t[1];
document.getElementById("Neighbourhood3").innerHTML = "" + t[2];
document.getElementById("Neighbourhood4").innerHTML = "" + t[3];
document.getElementById("Neighbourhood5").innerHTML = "" + t[4];
document.getElementById("Neighbourhood6").innerHTML = "" + t[5];
document.getElementById("Neighbourhood7").innerHTML = "" + t[6];
document.getElementById("Neighbourhood8").innerHTML = "" + t[7];
if (t[8] == "start") {
var r = document.getElementsByClassName("Neighbourhood");
for (var i = 0; i < r.length; i++) {
r[i].style.display = ""
}
}
if (t[8] == "Neighbourhood") {
var r = document.getElementsByClassName("kit");
for (var i = 0; i < r.length; i++) {
r[i].style.display = ""
}
}
}