suzie 4 Posted January 26, 2012 Report Share Posted January 26, 2012 Dear I have a form, with an <input> <input type="submit" value="submit" onclick='Submit_voting();' /> this form contains 2 radio button..on submit "Submit_voting();" is called to do the calculation upon the checked radio button...till now no problem, when javascript finishm and return data, I want that this javascript open a popup window. this popupwindow can be opened by: <a class="lightbox-opener" href='#popup8' id='link_content' >Sample Popup</a> <div class="lightbox-news lightbox-window" id="popup1" style="height:500px"> </div> but what I need, is that only when click on submit, to do the calculation and open the popup with href="#popup8" my javascript is: <script type="text/javascript">function Submit_voting() { chosen = "" len = document.f1.r1.length for (i = 0; i <len; i++) { if (document.f1.r1[i].checked) { chosen = document.f1.r1[i].value } } $.ajax({ type: 'GET',url: 'voting.php',data: {chosen: chosen},success: function(data) { alert(data); } }); } </script> please need help 1 Quote Link to post Share on other sites
justsomeguy 1,135 Posted January 26, 2012 Report Share Posted January 26, 2012 Whatever lightbox script you're using should have a method to open a popup given a certain ID. It looks like the ID you want to use is popup8. Quote Link to post Share on other sites
suzie 4 Posted January 27, 2012 Author Report Share Posted January 27, 2012 (edited) yes the id I want to use is popup8, but please can you tell what is this method to open this popupwindow, from the function Submit_voting after success: function(data) { alert (data); please I need it Edited January 27, 2012 by suzie Quote Link to post Share on other sites
Ingolme 1,032 Posted January 27, 2012 Report Share Posted January 27, 2012 Check the documentation of the lightbox script you're using, I don't know what script you're using but you have it there so you should look for the documentation. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.