0
我期待將此代碼更改爲下拉菜單,更改列表是好的,但無法找出onclick事件。Javascript單選按鈕到下拉瓦特/驗證
for (var z = 0; z < ShipTable.length; z++)
sOutput += "< input type=radio name=\"ZONE\" value=\"" + z
+ "\"" + (z == ZoneChecked ? " checked" : "")
+ " onClick=\"NewZone(this.value)\">" + ShipTable[z].zone + ";
我已經改變到上述
sOutput += "<select class=\"nopselect\" onClick=\"NewZone()\"><option>Select Delivery< /option>";
for (var z = 0; z < ShipTable.length; z++)
sOutput += "< option name=\"ZONE\" value=\"" + z
+ "\" >" + ShipTable[z].zone + "</option>";
sOutput += " < /select></TD> < /TR>";
不過這個功能需要此功能與降紮實工作
function NewZone(value) {
SetCookie("ZoneSelected", value, null, "/");
var RegionCookie = iGetCookie("RegionSelected");
if (RegionCookie != null && RegionFromZone.length && !Element(RegionCookie, RegionFromZone[ZoneParam])) DeleteCookie("RegionSelected", "/");
location.href = location.href;
}