0

I have a form that takes input from a dropdown list now and onsubmit opens a new tab getting the value from the selector.

Pseudoexample:

<form xmlns="http://www.w3.org/1999/xhtml" action="http://google." method="get" target="_blank">
  <select>
    <option value="com">com</option>
    <option value="co.uk">co.uk</option>
  </select>
  <input type="submit" value="Go" />
</form>

My question is whether it would be possible to change the select to checkboxes and open n windows for n checkboxes checked. e.g. in this example if both com and co.uk are selected, 2 windows will open instead of google.com.co.uk

I know I can do it in javascript (and I have already) avoiding forms entirely. This is not an option however, as this is to be hosted on google sites, which don't allow window.open()

Minas Abovyan
  • 671
  • 1
  • 6
  • 15
  • I guess what I have in mind is some form of a for-each loop through the inputs.. To the best of my knowledge there is no such thing though, so I'm looking for alternatives – Minas Abovyan Jun 05 '14 at 20:41
  • make the form submit upon a value being checked off. if you use jquery it may be a bit easier. – 13ruce1337 Jun 05 '14 at 20:43
  • if that were possible (haven't tried), wouldn't that open a new window and steal the focus? So to open a second one you'd have to go back to the original and click again, in essence opening windows 1 at a time, which is no different from what I have now. The idea is to open a group of windows at once – Minas Abovyan Jun 05 '14 at 20:45
  • http://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-using-javascript what are you trying to do? are you saying after the user selects all windows he wants open, he submits? – 13ruce1337 Jun 05 '14 at 20:51
  • 1. user selects N checkboxes; 2. user hits submit; 3. user gets N windows opened, 1 for each checkbox. I repeat, window.open *is not available* in google sites. – Minas Abovyan Jun 05 '14 at 20:52

0 Answers0