Jump to content

open a popup window from javascript


suzie

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...