![]() | |
| | #1 (permalink) |
| Bi Kendini Kurtaramayan Üyelik Tarihi: 04/2007
Mesaj: 158
|
Benim sorunum şu; bir test scripti yazıyorum.. İnsanlık hali testi dodururken bi soruyu işaretledik ama sonra vazgeçtik boş bırakmaya karar verdik... Şimdi bir radyo butonu işaretledikten sonra işretlemeyi iptal etmek için yani radio butonu işaretlenmemiş hale getirmek için gerekli kodu bulamadım ... Yardım ederseniz sevinirim ... |
| | |
| | #2 (permalink) |
| Üye Üyelik Tarihi: 05/2007
Mesaj: 26
| PHP Kodu: Kod: <input type="radio" name="radyo" ><label onclick="this.previousSibling.checked=(!this.previousSibling.checked)">işaretle / işaretleme</label> |
| | |
| | #3 (permalink) |
| Bi Kendini Kurtaramayan Üyelik Tarihi: 04/2007
Mesaj: 158
|
Evet aslında bu çözümü düşündüm ama ben ayrıca bi yere değilde radio butonun üzerine tıklanınca secilcek ve secilmicek... radio butonun Onclick olayında bu fonksiyonu kullanıncada radyo butonu hiç secilmiyo... Bu benim odevim için lazımdı ve bende düşündüm tasındım ve kendim bi kod yazmaya karar verdim... Aslında cok basit gorunuyo olay ama cözümü için malesef kod yazmaya gerek duyuluyo... Görünüşününde güzel olması açısından bi kod yazdım ... Fena olmadı en azından kullanışlı gözüküyo.... Aşağıda kodlar var ... Kodların çalışır halide bu linkde mutlaka bakın; http://ceviz_kurtaran.4sql.net/ceviz.php Kod:
<?php
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
/// ///
/// Kurtaran - Secenek olusturma scripti ///
/// 05/2007 © ///
/// ///
/// http://forum.ceviz.net/radio-buton-sorunu-t43175.html ///
/// ///
/// ///
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
if($_POST['submit']){
$sor1 = $_POST['se1']?$_POST['se1']:"Bos";
$sor2 = $_POST['se2']?$_POST['se2']:"Bos";
$sor3 = $_POST['se3']?$_POST['se3']:"Bos";
$sor4 = $_POST['se4']?$_POST['se4']:"Bos";
$sor5 = $_POST['se5']?$_POST['se5']:"Bos";
$sor6 = $_POST['se6']?$_POST['se6']:"Bos";
echo "<u>1. Soru</u>: <b>".strtoupper($sor1)."</b><br>";
echo "<u>2. Soru</u>: <b>".strtoupper($sor2)."</b><br>";
echo "<u>3. Soru</u>: <b>".strtoupper($sor3)."</b><br>";
echo "<u>4. Soru</u>: <b>".strtoupper($sor4)."</b><br>";
echo "<u>5. Soru</u>: <b>".strtoupper($sor5)."</b><br>";
echo "<u>6. Soru</u>: <b>".strtoupper($sor6)."</b><br>";
}
?>
<script>
function secme(ele, hid, hidval, so_no){
//ele.style.background='#069';
if(ele.style.background){
for(i=1;i<=5;i++){
document.getElementById("so"+so_no+"se"+i).style.background='';
//ele.innerHTML=ele.rel.value;
}
ele.style.background='';
var hidval2 = hidval.toLowerCase();
ele.innerHTML= "<img src='img/"+hidval2+"2.png'>";
document.getElementById(hid).value = '';
document.getElementById("inn").value = document.getElementById(hid).value;
}else{
for(i=1;i<=5;i++){
document.getElementById("so"+so_no+"se"+i).style.background='';
var res = document.getElementById("so"+so_no+"se"+i).title;
res = res.toLowerCase();
document.getElementById("so"+so_no+"se"+i).innerHTML= "<img src='img/"+res+"2.png'>";
}
ele.style.background='url(check.gif)';
ele.innerHTML='';
document.getElementById(hid).value = hidval;
document.getElementById("inn").value = document.getElementById(hid).value;
}
//document.getElementById("inn").value = '55';
//var renk = ele.style.background?'':'#069';
//ele.style.background=renk;
document.getElementById("inn").value = ele.rel.value;
}
</script>
<div id='genel' style='width:260px;'>
<form name='form_cevap' method='POST' action=''>
<input type='hidden' name='soru_sayi' value='6'>
<table style='width:260px;border:1px solid #069;'><tr><td>1. Soru</td>
<td><div title='A' id='so1se1' onclick="secme(this, 'se1', 'A', '1')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so1se2' onclick="secme(this, 'se1', 'B', '1')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so1se3' onclick="secme(this, 'se1', 'C', '1')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so1se4' onclick="secme(this, 'se1', 'D', '1')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so1se5' onclick="secme(this, 'se1', 'E', '1')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se1' id='se1' value=''></td></tr>
<tr><td>2. Soru</td>
<td><div title='A' id='so2se1' onclick="secme(this, 'se2', 'A', '2')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so2se2' onclick="secme(this, 'se2', 'B', '2')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so2se3' onclick="secme(this, 'se2', 'C', '2')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so2se4' onclick="secme(this, 'se2', 'D', '2')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so2se5' onclick="secme(this, 'se2', 'E', '2')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se2' id='se2' value=''></td></tr>
<tr><td>3. Soru</td>
<td><div title='A' id='so3se1' onclick="secme(this, 'se3', 'A', '3')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so3se2' onclick="secme(this, 'se3', 'B', '3')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so3se3' onclick="secme(this, 'se3', 'C', '3')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so3se4' onclick="secme(this, 'se3', 'D', '3')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so3se5' onclick="secme(this, 'se3', 'E', '3')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se3' id='se3' value=''></td></tr>
<tr><td>4. Soru</td>
<td><div title='A' id='so4se1' onclick="secme(this, 'se4', 'A', '4')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so4se2' onclick="secme(this, 'se4', 'B', '4')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so4se3' onclick="secme(this, 'se4', 'C', '4')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so4se4' onclick="secme(this, 'se4', 'D', '4')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so4se5' onclick="secme(this, 'se4', 'E', '4')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se4' id='se4' value=''></td></tr>
<tr><td>5. Soru</td>
<td><div title='A' id='so5se1' onclick="secme(this, 'se5', 'A', '5')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so5se2' onclick="secme(this, 'se5', 'B', '5')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so5se3' onclick="secme(this, 'se5', 'C', '5')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so5se4' onclick="secme(this, 'se5', 'D', '5')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so5se5' onclick="secme(this, 'se5', 'E', '5')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se5' id='se5' value=''></td></tr>
<tr><td>6. Soru</td>
<td><div title='A' id='so6se1' onclick="secme(this, 'se6', 'A', '6')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/a2.png'></div> </td>
<td><div title='B' id='so6se2' onclick="secme(this, 'se6', 'B', '6')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/b2.png'></div> </td>
<td><div title='C' id='so6se3' onclick="secme(this, 'se6', 'C', '6')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/c2.png'></div> </td>
<td><div title='D' id='so6se4' onclick="secme(this, 'se6', 'D', '6')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/d2.png'></div> </td>
<td><div title='E' id='so6se5' onclick="secme(this, 'se6', 'E', '6')" style='width: 25px;height: 25px;border: 1px solid #069;text-align: center;font-weight: bold;font-family: Arial;'><img src='img/e2.png'></div> </td>
<td><input type='hidden' name='se6' id='se6' value=''></td></tr>
</table><input type='submit' name='submit' value='Cevaplarý Gönder'>
</form>
</div>
|
| | |
| | #5 (permalink) |
| Deli Olmak Akıl İster Üyelik Tarihi: 09/2007 Yer: Ankara
Mesaj: 1,368
|
taam a seçeneğini işratledim. sonra vazcaydım ve seçeneği kaldırım b seçmek istedim. işte o zaman işe yaramıyor. bence bir radio buton daha ekle ve adını boş bırakmak istiyorum diye adlandır en alta. bu şekilde daha güvenilir ve hızlı olur diye düşünüyorum. kolay gelsin not: sayfa yüklenirken scriptin hata veriyor.
__________________ ################################ Kestiğin Ümitlerden Yelkenlerde Yaptım Ama... Yokluğunda Ne Gidebildim Ne De Kaldım. ############################### |
| | |
| | #6 (permalink) | |
| Üye Üyelik Tarihi: 05/2007 Yer: Zonguldak
Mesaj: 490
| Alıntı:
__________________ Not Defterim | |
| | |
![]() |
| Bookmarks |
| Seçenekler | |
| |
Benzer Konular | ||||
| Konu | Konuyu açana göre | Forum | Cevap | En Son Mesaj |
| kaç radio buton işaretlenmiş ve toplam değeri ne? | kamehame | Javascript / DHTML / Ajax | 1 | 27/02/2007 14:25 |
| <td> içerisinde radio buton nie olmuyor?? | sofistike | ASP | 1 | 29/12/2006 11:03 |
| Radio buton ile resim seçimi ? | SeFFaF | PHP | 6 | 26/05/2006 12:27 |
| radio buton hata denetimi yapılabilir mi? | sineld | Javascript / DHTML / Ajax | 7 | 10/10/2005 10:24 |
| Radio Buton Rengi | fafnir | Web Tasarım | 8 | 10/04/2004 10:08 |
| Reklamlar & Desteklenenler | |
| Hassas Valf | Hassas Kaplama | Antalyamız | Gazete | Ticari Bilişim | Hakan Müştak | Rüya Tabirleri | Kadın | Hastalıklar | Cepte msn ve e-posta | Webmaster | Antalya Aupair | Turkish Property Antalya | Forum | Chat | Perde | Adsl | Araba | bolindir.com | guncelle.com | livescore | Web Tasarım | evden eve nakliyat | forum | evden eve | sohbet | Resimcim| Kalifiye İnsan Kaynakları | Web Tasarım | Oyun | Yusuf KOÇ | Akın Yorulmaz | şiir | UFO | Web Tasarım | Oyunlar | Canlı Tv | Malta | |