Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript function freezing my browser
    primarykey
    data
    text
    <p>i have two select object one with begining time and one with ending time. when i select for example 11:00 in begining time i want that all options before 11:00 in ending time bee disabled 11:15 selected and rest options selectable. Also i want to say that i am newbie with javascript.</p> <p>This is part of my HTML code: </p> <pre><code>&lt;select id="rbaslasaat" onchange="bitissaati(1384581600, 1384586100);"&gt; &lt;option value="1384581600"&gt;10:00&lt;/option&gt; &lt;option value="1384582500"&gt;10:30&lt;/option&gt; &lt;option value="1384583400"&gt;11:00&lt;/option&gt; &lt;option value="1384584300"&gt;11:30&lt;/option&gt; &lt;option value="1384585200"&gt;12:00&lt;/option&gt; &lt;option value="1384586100"&gt;12:30&lt;/option&gt; &lt;/select&gt;&lt;/div&gt; &lt;select id="rbitirsaat"&gt; &lt;option id="saatb1384581600" value="1384581600" disabled=""&gt;10:00&lt;/option&gt; &lt;option id="saatb1384582500" value="1384582500" disabled=""&gt;10:30&lt;/option&gt; &lt;option id="saatb1384583400" value="1384583400" disabled=""&gt;11:00&lt;/option&gt; &lt;option id="saatb1384584300" value="1384584300" disabled=""&gt;11:30&lt;/option&gt; &lt;option id="saatb1384585200" value="1384585200" disabled=""&gt;12:00&lt;/option&gt; &lt;option id="saatb1384586100" value="1384586100" disabled=""&gt;12:30&lt;/option&gt; &lt;/select&gt;&lt;/div&gt; </code></pre> <p>and this is my JavaScript function:</p> <pre><code>function bitissaati(saata, saatb) { var saata, saatb, saatc, saatca, sec, i; saatc = document.getElementById('rbaslasaat'); saatca = saatc.options[saatc.selectedIndex].value; sec = parseInt(saatca) + 900; for (i = saata; i&lt;= saatb; i + 900) { if(i &lt;= saatca ) { document.getElementById('saatb'+i).disabled=true; } else { document.getElementById('saatb'+i).disabled=false; } } document.getElementById('saatb'+sec).selected=true; } </code></pre> <p>i could not figured out what the problem is. each time i try function my browser is freezing.</p> <p>Thank you all for trying to help</p>
    singulars
    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