Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check dynamically with radio box is selected in the div
    primarykey
    data
    text
    <p>I need a dynamic function for checking whether a <code>radio box</code> is selected in the <code>div</code> or not.</p> <p>Actually I want to show an error message every time an user, without selecting the <code>radio button</code>, presses the next button.</p> <p>I am working on this <a href="http://www.gomlekevi.com/indexDESIGN.php" rel="nofollow">page</a>. The <strong>ILERI</strong> means <strong>NEXT</strong>.</p> <p>These are the divs. There are 9 div on the page cited above.</p> <pre><code>&lt;div id="div2" class="targetDiv"&gt; &lt;a id="back" class="ileri-geri" target="1" &gt;GERİ&lt;/a&gt; &lt;h1&gt;Cep Çesitleri&lt;/h1&gt; &lt;a class="ileri-geri" target="3"&gt;İLERİ&lt;/a&gt; &lt;div class="urunler"&gt; &lt;ul class="urun"&gt; &lt;li&gt;&lt;img src="imagesBOX/items/cepsayisi/0.jpg"&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Cepsiz&lt;/p&gt;&lt;input type="radio" name="cep_cesitleri" value="0" /&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="urun"&gt; &lt;li&gt;&lt;img src="imagesBOX/items/cepsayisi/1.jpg"&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Tek Cepli&lt;/p&gt;&lt;input type="radio" name="cep_cesitleri" value="1" /&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="urun"&gt; &lt;li&gt;&lt;img src="imagesBOX/items/cepsayisi/2.jpg"&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Çift Cepli&lt;/p&gt;&lt;input type="radio" name="cep_cesitleri" value="2" /&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;h1&gt;Cep Sayisi&lt;/h1&gt;&lt;br/&gt; &lt;?php foreach($Secondresult As $jcRow): ?&gt; &lt;ul class="urun"&gt; &lt;li&gt;&lt;img src="imagesBOX/items/cep_cesitleri/&lt;?php echo $jcRow-&gt;image ?&gt;" /&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&lt;?php echo $jcRow-&gt;title ?&gt;&lt;/p&gt;&lt;input type="radio" name="cep_cesitleri" value="&lt;?php echo $jcRow-&gt;id ?&gt;" /&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;?php endforeach; ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;!----2nd page---&gt; </code></pre> <p>this is javascript which hides all the div and show the div only based on target attribute of tag .</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $('.targetDiv').hide(); $('#divfirst').show(); $(".ileri-geri").click(function(event){ $('.targetDiv').hide(); $('#div'+$(this).attr('target')).fadeIn('slow'); //alert("Redirecting you to jQuery.com!"); }); &lt;/script&gt; </code></pre> <p>Now I want that, If user click on <code>ILERI</code> button without selecting the radio option, then the error mesg will appear, but the function should dynamically show that it handles all the 9 div on this page.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload