0n3Liner
Legacy Member
Ok ik zit hier dus mlet een probleempje, dit script werkt eprfect in FireFox, maar Ie laat het afweten, in netscape heb ik het nog niet getest.
Iemand een idee waar de fout zit?
Iemand een idee waar de fout zit?
Code:
<script type="text/javascript">
function calculate () {
var where = document.order;
if((where.game.value !== '') && (where.type.value !== '') && (where.players.value !== '') && (where.timespan.value !== '')) {
var players = where.players.value;
var type = where.type.value;
var timespan = where.timespan.value;
var debranding = where.debranding.checked;
//slotprice
if(type == 'Public') {
var slotprice = 1.80;
} else if(type == 'Private') {
var slotprice = 1.08;
}
//als er debranding is geselecteerd
if(debranding == true) {
var monthprice = 4;
document.getElementById('debranding').innerHTML = '';
document.getElementById('reboot').innerHTML = 'FREE!';
where.rebootscript.disabled = true;
} else {
var monthprice = 0;
document.getElementById('debranding').innerHTML = 'By game-systems.be';
document.getElementById('reboot').innerHTML = '';
where.rebootscript.disabled = false;
}
//prijs berekenen
var monthprice = (slotprice * players) + monthprice;
var totalprice = monthprice * timespan;
//korting berekenen
if(timespan == 6) {
var totalpercent = (totalprice/100) * 5;
var extra = '-5%!';
} else if(timespan == 12) {
var totalpercent = (totalprice/100) * 10;
var extra = '-10%!';
} else {
var totalpercent = 0;
var extra = '';
}
//afronden op 2 na de komma
monthprice = Math.round(monthprice*100)/100 ;
totalprice = Math.round((totalprice - totalpercent)*100)/100;
document.getElementById('monthprice').innerHTML = monthprice+'€';
document.getElementById('totalprice').innerHTML = '<b>'+totalprice+'€</b> '+extra;
}
}
function o (where,which) {
where.src = 'images/'+which+'_o.gif';
}
function ot (where,which) {
where.src = 'images/'+which+'.gif';
}
function go (where) {
window.location = where;
}
</script>
<form name="order">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td style="width: 30%" valign="top">Game:</td>
<td><select name="game" size="8" style="width:198px;" onclick="javascript:calculate()">
<option value="Counter-Strike"> Counter-Strike</option>
<option value="Counter-Strike: Source"> Counter-Strike: Source</option>
<option value="Day of Defeat"> Day of Defeat</option>
<option value="Counter-Strike: Condition Zero"> Counter-Strike: Condition Zero</option>
<option value="Half-Life"> Half-Life</option>
<option value="Half-Life 2"> Half-Life 2</option>
<option value="Half-Life 2: Deathmatch"> Half-Life 2: Deathmatch</option>
<option value="Other HL or HL2 Mod"> Other HL or HL2 Mod</option>
<option value="Soldier Of Fortune"> Soldier Of Fortune</option>
<option value="Soldier Of Fortune 2"> Soldier Of Fortune 2</option>
<option value="Soldier of Fortune Mod"> Soldier of Fortune Mod</option>
<option value="Medal of Honor: Allied Assault"> Medal of Honor: Allied Assault</option>
<option value="Medal of Honor: Spearhead"> Medal of Honor: Spearhead</option>
<option value="BattleField 1942"> BattleField 1942</option>
<option value="BattleField Vietnam"> BattleField Vietnam</option>
<option value="BattleField 1942/Vietnam Mod"> BattleField 1942/Vietnam Mod</option>
<option value="Jedi Knights 2: Outcast"> Jedi Knights 2: Outcast</option>
<option value="Quake 3"> Quake 3</option>
</select>
</td>
</tr>
<tr>
<td style="width: 30%" valign="top">Server type:</td>
<td valign="top">
<select name="type" size="2" style="width:198px;" onclick="javascript:calculate()">
<option value="Public"> Public</option>
<option value="Private"> Private</option>
</select>
</td>
</tr>
<tr>
<td style="width: 30%" valign="top">Players:</td>
<td valign="top">
<select name="players" size="8" style="width:198px;" onclick="javascript:calculate()">
<option value="8"> 8 Slots</option>
<option value="10"> 10 Slots</option>
<option value="12"> 12 Slots</option>
<option value="14"> 14 Slots</option>
<option value="16"> 16 Slots</option>
<option value="18"> 18 Slots</option>
<option value="20"> 20 Slots</option>
<option value="22"> 22 Slots</option>
</select>
</td>
</tr>
<tr>
<td style="width: 30%" valign="top">Timespan:</td>
<td valign="top">
<select name="timespan" size="3" style="width:198px;" onclick="javascript:calculate()">
<option value="3"> 3 Months</option>
<option value="6"> 6 Months</option>
<option value="12"> 12 Months</option>
</select>
</td>
</tr>
<tr>
<td style="width: 30%" valign="top">Debranding:</td>
<td valign="top"> <input type="checkbox" name="debranding" value="Yes" onclick="javascript:calculate()"> Yes<br></td>
</tr>
<tr>
<td style="width: 30%" valign="top">Server Reboot Script:</td>
<td valign="top"> <input type="checkbox" name="rebootscript" value="Yes" onclick="javascript:calculate()"> Yes <span id="reboot" style="color: #009900"></span></td>
</tr>
<tr>
<td style="width: 30%">FTP username: (**)</td>
<td><input type="text" name="ftplogin" maxlength="32" style="width:198px;"></td>
</tr>
<tr>
<td style="width: 30%">FTP password: (**)</td>
<td><input type="text" name="ftploginpassword" maxlength="32" style="width:198px;"></td>
</tr>
<tr>
<td style="width: 30%">RCON password: (**)</td>
<td><input type="text" name="rconpassword" maxlength="32" style="width:198px;"></td>
</tr>
<tr>
<td style="width: 30%">Server name: (**)</td>
<td><input type="text" name="servername" maxlength="100" style="width:198px;"><br><div id="debranding">By game-systems.be</div></td>
</tr>
<tr>
<td style="width: 30%">Monthly price:</td>
<td><b><div id="monthprice">0€</div></b></td>
</tr>
<tr>
<td style="width: 30%">Total price:</td>
<td><div id="totalprice"><b>0€</b></div></td>
</tr>
</table>
<div style="text-align: center"><input type="reset" value="Reset"> <input type="submit" value="Continue"></div>
</form>

,