Note that there are some explanatory texts on larger screens.

plurals
  1. POopening a fancybox from a drop down box and passing the selected value to it directly
    primarykey
    data
    text
    <pre><code>&lt;select name="mySelectboxsituation_found" id="mySelectboxsituation_found"&gt; &lt;option value="100"&gt;Firecall&lt;/option&gt; &lt;option value="200"&gt;FireAlarm&lt;/option&gt; &lt;option value="300"&gt;FireAlarm2&lt;/option&gt; &lt;option value="400"&gt;FireAlarm4&lt;/option&gt; &lt;/select&gt; &lt; a href="#" class="incidenttype" name="all" onClick="JavaScript:var dropdown=document.getElementById('mySelectboxsituation_found');this.href='main_situation_found.php?incident_maincateid='+dropdown.options[dropdown.selectedIndex].value;return true;"/&gt;CLICK HERE &lt; / a&gt; function cleanUp(){ var subsituation_found1 = $("#fancybox- frame").contents().find('input:radio[name=incident_subcate]:checked').val(); } $(".incidenttype").fancybox({ 'width' : 900, 'height' : 600, 'autoScale': false, 'transitionIn': 'none', 'transitionOut': 'none', 'type': 'iframe', 'onCleanup': cleanUp ); }); </code></pre> <p>clicking on "CLICK HERE" opens the fancybox and transfers the value selected in the drop down box. </p> <p>What I would like to do is open the fancy box when i change the value in the dropdown box...without having to click on the click here link.....i know it is posisble using something like _this....but i am not sure and am looking for some direction...</p> <p>ideally some thing like this ...</p> <pre><code> &lt;select name="mySelectboxsituation_found" id="mySelectboxsituation_found" onChange="JavaScript:var dropdown=document.getElementById('mySelectboxsituation_found');this.href='main_situation_found.php?incident_maincateid='+dropdown.options[dropdown.selectedIndex].value;return true;"&gt; &lt;option value="100"&gt;Firecall&lt;/option&gt; &lt;option value="200"&gt;FireAlarm&lt;/option&gt; &lt;option value="300"&gt;FireAlarm2&lt;/option&gt; &lt;option value="400"&gt;FireAlarm4&lt;/option&gt; &lt;/select&gt; </code></pre> <p>does any have an idea how to do it....</p> <p>I have also tried...</p> <pre><code>function test_fan() { alert(document.getElementById('mySelectboxsituation_found').options[document.getElementById('mySelectboxsituation_found').selectedIndex].value); var dropval =document.getElementById('mySelectboxsituation_found').options[document.getElementById('mySelectboxsituation_found').selectedIndex].value; return dropval; } $(document).ready(function(){ $("#autostart").fancybox({ 'onStart':test_fan, 'width': 800, 'height': 700, 'type': 'iframe', href:'main_situation_found.php?incident_maincateid='+document.getElementById('mySelectboxsituation_found').options[document.getElementById('mySelectboxsituation_found').selectedIndex].value }); &lt;a href="#" id="autostart" style="display:none"&gt;&lt;/a&gt; &lt;form&gt;&lt;select id="mySelectboxsituation_found" onchange="$('#autostart').trigger('click');"&gt; &lt;option value=""&gt;select&lt;/option&gt; &lt;option value="100"&gt;option 1&lt;/option&gt; &lt;option value="200"&gt;trigger&lt;/option&gt; &lt;option value="300"&gt;option 3&lt;/option&gt; &lt;option value="400"&gt;option 4&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre> <p>the really funny that happens there is that ....</p> <p>on the alert id do get the value i selected so if i </p> <pre><code>selected alert fancybox window 100 100 nothing shows up empty 200 200 100 300 300 200 400 400 300 </code></pre> <p>the fancybox seems to me the the previously selected values and i am not sure why that is happening... thanks andy</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