suzie Posted January 26, 2012 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted January 26, 2012 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. Link to comment Share on other sites More sharing options...
suzie Posted January 27, 2012 Author Share Posted January 27, 2012 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 Link to comment Share on other sites More sharing options...
Ingolme Posted January 27, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.