wyślij formularz w nowej karcie

Chciałbym (po prostu przetestować niektóre funkcje, po uniknięciu tego zachowania) załadować stronę wywołaną przez submit na nowej karcie : czy to możliwe?

Author: William Perron, 2011-04-19

8 answers

<form target="_blank" [....]

Prześle formularz w nowej karcie... Nie jestem pewien, czy to jest to, czego szukasz, proszę wyjaśnić lepiej...

 189
Author: Strae,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-05-09 15:32:44

Mam przycisk [submit] i [preview] , Chcę, aby podgląd wyświetlał widok wydruku przesłanych danych formularza, bez utrzymywania ich w bazie danych. Dlatego chcę, aby [podgląd] otworzył się w nowej karcie, i submit, aby przesłać dane w tym samym oknie / karcie.

<button type="submit" id="liquidacion_save" name="liquidacion[save]" onclick="$('form').attr('target', '');">Save</button></div>    <div>
<button type="submit" id="liquidacion_Previsualizar" name="liquidacion[Previsualizar]" onclick="$('form').attr('target', '_blank');">Preview</button></div>  
 21
Author: juanmf,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-10-30 19:29:28

Dodaj target="_blank" do znacznika <form>.

 10
Author: ThiefMaster,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-10-22 11:16:24

Skoro masz to oznaczone jQuery, zakładam, że chcesz coś trzymać w funkcji sukcesu?

success: function(data){
    window.open('http://www.mysite.com/', '_blank');
}
 7
Author: SickHippie,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-10-22 11:18:20

Spróbuj użyć jQuery

<script type="text/javascript">
$("form").submit(function() {
$("form").attr('target', '_blank');
return true;
});
</script>

Oto pełna odpowiedź - http://ftutorials.com/open-html-form-in-new-tab/

 4
Author: webtech,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-09-15 23:34:49

Możliwe jest również użycie nowego atrybutu button o nazwie formtarget, który został wprowadzony w HTML5.

<form>
  <input type="submit" formtarget="_blank"/>
</form>
 3
Author: dragontree,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-03-06 13:52:48

Opcje przeglądarki muszą być ustawione, aby otwierać nowe okna na nowej karcie, w przeciwnym razie zostanie otwarte nowe okno przeglądarki.

 1
Author: ArtieJ,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-06-28 20:56:26

To będzie również działać świetnie, u można zrobić coś innego, podczas gdy nowa karta obsługi złożyć .

<form target="_blank">
    <a href="#">Submit</a>
</form>

<script>
    $('a').click(function () {
        // do something you want ...

        $('form').submit();
    });
</script>
 1
Author: Link,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-03-09 09:56:39