0

Submiting multiple forms in new tab not working in chrome browser. The concept was, there was n number of forms, where it was submitted by ‘jQuery each’ function. Every form will open on new tabs. Firefox and IE doesn't have any problem to open many tabs. But chrome was opening only one window at a time... How can i do with chrome?

Code:

<form class="form" method="post" action="www.someting.com" target="_blank">

<input type="text" name="FolioA" value="<?php echo $folio[0]?>" />
<input type="text" name="FolioB" value="<?php echo $folio[1]?>" />
<input type="text" name="FolioC" value="<?php echo $folio[2]?>" />
<input type="text" name="FolioD" value="<?php echo $folio[3]?>" />
<input type="submit" class="folio<?php echo $info_process['ProcessType'].$contract?>" />

</form> 

<form class="form" method="post" action="www.someting1.com" target="_blank">

<input type="text" name="FolioA" value="<?php echo $folio[0]?>" />
<input type="text" name="FolioB" value="<?php echo $folio[1]?>" />
<input type="text" name="FolioC" value="<?php echo $folio[2]?>" />
<input type="text" name="FolioD" value="<?php echo $folio[3]?>" />
<input type="submit" class="folio<?php echo $info_process['ProcessType'].$contract?>" />

</form> 


<form class="form" method="post" action="www.someting2.com" target="_blank">

<input type="text" name="FolioA" value="<?php echo $folio[0]?>" />
<input type="text" name="FolioB" value="<?php echo $folio[1]?>" />
<input type="text" name="FolioC" value="<?php echo $folio[2]?>" />
<input type="text" name="FolioD" value="<?php echo $folio[3]?>" />
<input type="submit" class="folio<?php echo $info_process['ProcessType'].$contract?>" />

</form> 

<script type="text/javascript">

  $('.form').each(function(index, value){
      $(this).submit();
  });
</script>
Dhamu
  • 1,694
  • 5
  • 22
  • 47
  • "Even when doing it via JS, a submit() initiates a new POST request to the server. You can only make one request at a time, that's why only the last shows up. I have no idea why it would work in FF. "- from http://stackoverflow.com/questions/1339006/problem-with-multi-forms-submission-in-ie-and-google-chrome – Istiaque Ahmed Dec 26 '13 at 10:47
  • I guess your problem lies with usage of multiple forms and accessing them in a wrong way. Why don't you read something on this answer: http://stackoverflow.com/questions/8712398/multiple-forms-or-multiple-submits-in-a-page It explains what's the best practice. – Nagaraj Tantri Dec 26 '13 at 10:56

1 Answers1

1

i hope this might work for you.

just change

target="_blank"

to

target="iframe"

Just change the code as like this :

<form class="form" method="post" action="www.someting.com" target="iframe1">

<input type="text" name="FolioA" value="<?php echo $folio[0]?>" />
<input type="text" name="FolioB" value="<?php echo $folio[1]?>" />
<input type="text" name="FolioC" value="<?php echo $folio[2]?>" />
<input type="text" name="FolioD" value="<?php echo $folio[3]?>" />
<input type="submit" class="folio<?php echo $info_process['ProcessType'].$contract?>" />

</form> 

<form class="form" method="post" action="www.someting1.com" target="iframe2">

<input type="text" name="FolioA" value="<?php echo $folio[0]?>" />
<input type="text" name="FolioB" value="<?php echo $folio[1]?>" />
<input type="text" name="FolioC" value="<?php echo $folio[2]?>" />
<input type="text" name="FolioD" value="<?php echo $folio[3]?>" />
<input type="submit" class="folio<?php echo $info_process['ProcessType'].$contract?>" />

</form> 
Jansha
  • 101
  • 3