开发者

How to Open Multiple PopUp windows with JQuery on form submission (popUps should be relative to form submited data)?

开发者 https://www.devze.com 2022-12-28 16:22 出处:网络
I have A HTML form like this: <form> <fieldset class=\"ui-widget-content ui-corner-all\">

I have A HTML form like this:

    <form> 
<fieldset class="ui-widget-content ui-corner-all"> 
<select id="Streams" class="multiselect ui-widget-content ui-corner-all" multiple="multiple" name="Streams[]"> 

<option value="35">  Example Name (35)</option> 
<option value="44">  Example Name (44)</option>  
<option value="5698">  Example Name (5698)</option> 
<option value="777">  Example Name (777)</option> 
<option value="12">  Example Name (12)</option>   
    </select> 

      <input type="submit" class="ui-state-default ui-corner-all" name="submitForm" id="submitForm"  value="Play Stream from selected URL's!"/> 
  </fieldset> 
</form>

in my JS + HTML page I use JQuery.

As you can see I allow user to select multiple Items.

I want to open on Submit button click as many popup windows as many Items he selected in a list. Each popUp window should open some url like www.example.com/test.php?id=OPTION_SELECTED .

And here I mean by PopUp Window a real brows开发者_开发知识库er window.

So for each of the selected options I ll get a pop up window whith diferent url.

Please Help.


it would be something like this...

$("form").submit(function() {
    int i = 0;
    $("#Streams option:selected").each(function() {
        window.open("www.example.com/test.php?id=" + $(this).val(),"window" + i.toString());
        i++;
    });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号