Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [js] problema function popup

    ciao raga,

    dato questo semplice codice:
    codice:
    function popup(url,a,b){
    	var w = screen.width
    	var h = screen.height
    	var sx= ((w-a)/2)
    	var su = ((h-b)/3)
    	x = "width="+a+",height="+b+",left="+sx+",top="+su
        window.open(url, 'FITART', x);
    lo applico a dei semplici link passando i 3 parametri: pagina,larghezza,altezza... fin qui tutto ok, il problema è che vorrei riutilizzare questa function anche all'invio di una form:

    codice:
    <form name="form1" method="post" action="newsletter.php" target="this.action" style="margin:0px;" onsubmit="return popup(this.action,300,200);">
    ho provato con this.action... ma mi apre una popup in modo giusto e una a tutto schermo, che sbalgio?

    grazie...

  2. #2
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Ciao Coach,

    tu apri una popup che si chiama 'FITART' quindi devi mettere nel target FITART
    codice:
    <form name="form1" method="post" action="newsletter.php" target="FITART" style="margin:0px;" onsubmit="popup('about:blank',300,200);">

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.