Jump to content

open a popup window from javascript


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

  • Like 1
Link to post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...