Şimdi Ara

Javascript Yardım

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
1 Misafir - 1 Masaüstü
5 sn
1
Cevap
0
Favori
294
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Merhaba Arkadaşlar,

    Elimde javascriptle yazılmış html bir sayfa var. Sayfada 10x10 koltuk içeren bir sinema salonu koltuk dizilimi gorunuyor. Yazılan kodların sonucunda secılı kutucukların fıyatlarının toplamı ve kac tane koltuk secıldıgı yazıyor. Ben bunu biraz daha geliştirirek onay verıldıgınde Kaç koltuk secıldıgı ve toplam fıyatın ne oldugu gorunecek ve onay vermemizi bekleyecek. Onay verirsek odeme sayfasına yonlendirilecek. Onay verlmezse bırsey yapmayacak. Çıkamadım işin ıcınden yardımcı olursanız sevınırım. Ayrıca butun koltukların fıyatları farklı.


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>

    <script language="javascript">



    function gonder(){
    var toplam=0;
    var i=1;
    var j=0;
    for(i=1;i<=100;i++){
    if(document.getElementById(i).checked==true){
    j++;
    toplam=toplam+parseFloat(document.getElementById(i).value);
    }
    }

    alert(j +" adet koltuk seçtiniz.\nToplam ödemeniz gereken tutar: " + Math.round(toplam*100)/100);
    }


    </script>

    </head>

    <body>
    <form id="form1" name="form1" method="post" action="">
    <table border="0" align="center">
    <tr><th>10</th><th>9</th><th>8</th><th>7</th><th>6</th><th>5</th><th>4</th><th>3</th><th>2</th><th>1</th></tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="1" value="6.79" /> </td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><label>
    <input type="checkbox" id="2" value="6.81" />
    </label></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="3" value="6.83" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="4" value="6.84" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="5" value="6.84" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="6" value="6.84" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="7" value="6.84" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="8" value="6.83" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="9" value="6.81" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="10" value="6.79" /></td><th>K</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="11" value="7" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="12" value="7.02" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="13" value="7.04" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="14" value="7.06" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="15" value="7.07" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="16" value="7.07" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="17" value="7.06" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="18" value="7.04" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="19" value="7.02" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="20" value="7" /></td><th>J</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="21" value="7.24" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="22" value="7.27" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="23" value="7.30" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="24" value="7.32" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="25" value="7.33" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="26" value="7.33" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="27" value="7.32" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="28" value="7.3" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="29" value="7.27" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="30" value="7.24" /></td><th>H</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="31" value="7.52" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="32" value="7.57" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="33" value="7.6" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="34" value="7.62" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="35" value="7.64" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="36" value="7.64" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="37" value="7.62" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="38" value="7.6" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="39" value="7.57" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="40" value="7.52" /></td><th>G</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="41" value="7.86" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="42" value="7.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="43" value="7.97" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="44" value="8" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="45" value="7.98" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="46" value="7.98" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="47" value="8" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="48" value="7.97" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="49" value="7.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="50" value="7.86" /></td><th>F</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="51" value="7.73" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="52" value="7.64" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="53" value="7.57" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="54" value="7.53" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="55" value="7.5" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="56" value="7.5" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="57" value="7.53" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="58" value="7.57" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="59" value="7.64" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="60" value="7.73" /></td><th>E</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="61" value="7.22" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="62" value="7.09" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="63" value="6.99" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="64" value="6.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="65" value="6.89" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="66" value="6.89" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="67" value="6.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="68" value="6.99" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="69" value="7.09" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="70" value="7.22" /></td><th>D</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="71" value="6.57" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="72" value="6.39" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="73" value="6.24" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="74" value="6.13" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="75" value="6.07" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="76" value="6.07" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="77" value="6.13" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="78" value="6.24" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="79" value="6.39" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="80" value="6.57" /></td><th>C</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="81" value="5.75" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="82" value="5.46" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="83" value="5.21" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="84" value="5.03" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="85" value="4.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="86" value="4.92" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="87" value="5.03" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="88" value="5.21" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="89" value="5.46" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="90" value="5.75" /></td><th>B</th>
    </tr>
    <tr>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="91" value="4.67" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="92" value="4.18" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="93" value="3.75" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="94" value="3.41" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="95" value="3.23" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="96" value="3.23" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="97" value="3.41" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="98" value="3.75" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="99" value="4.18" /></td>
    <td width="40" height="55" background="koltuk.gif" align="center" valign="top"><input type="checkbox" id="100" value="4.67" /></td><th>A</th>
    </tr>
    </table>

    <p>  </p>
    <p> </p>
    <center>
    <label>Seçilen koltukların fiyatını göster...
    <input type="button" name="a" id="a" value="Onayla" onclick="gonder()"/>
    </label>
    </center>
    </form>
    </body>
    </html>







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.