Народ плиз подскажите, я только сегодня сел за джава скрипт все вроде радотает, но в IE, Chrome и Safari нехочет. У когото есть идеи?
<script language="JavaScript">
function countit(form) {
var TicketCount = form.TicketCount.value;
var TicketVipCount = form.TicketVipCount.value;
var TableCount = form.TableCount.value;
var TicketPrice = 40;
var TicketVipPrice = 100;
var TablePrice = 50;
var MyCount = 278;
if (TicketPrice != '0') {
var TicketExit = parseFloat(TicketPrice) * TicketCount;
}
else {
var TicketExit = 0;
}
if (TicketVipPrice != '0') {
var TicketVipExit = parseFloat(TicketVipPrice) * TicketVipCount;
}
else {
var TicketVipExit = 0;
}
if (TablePrice != '0') {
var TableExit = parseFloat(TablePrice) * TableCount;
}
else {
var TableExit = 0;
}
var SumPrice = TicketExit + TicketVipExit + TableExit;
if (SumPrice >= MyCount) {
document.getElementById('but').disabled = true;
var NeedToPay = SumPrice - MyCount;
document.getElementById('debug').innerHTML = 'ERROR :) '+ NeedToPay +' ';
}
else {
document.getElementById('but').disabled = false;
document.getElementById('debug').innerHTML = SumPrice.toFixed(2);
}
}
</script>
<form method="POST" onChange="countit(this)">
<table border="0" cellspacing="4" cellpadding="3">
<tr><td style="color: #3A7611; vertical-align: middle">Кількість квитків:</td><td><select name="TicketCount" size="1"><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option></select></td></tr>
<tr><td style="color: #3A7611; vertical-align: middle">Кількість VIP квитків:</td><td><select name="TicketVipCount" size="1"><option>0</option><option>1</option><option>2</option></select></td></tr>
<tr><td style="color: #3A7611; vertical-align: middle">Кількість столиків:</td><td><select name="TableCount" size="1"><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select></td></tr>
</table>
<input type="submit" id="but">
</form>
<div id="debug"></div>