nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

novizio domanda su passare valori tra form

Von: luca72 (lucaberto@libero.it) [Profil]
Datum: 11.06.2008 17:57
Message-ID: <333955cb-cb37-4553-981a-29e122dffdf5@i76g2000hsf.googlegroups.com>
Newsgroup: it.comp.lang.javascript
Ciao a tutti ho questo tipo di script

var newWindow = null;
function makeNewWindow() {
//check if window already exists
if (!newWindow || newWindow.closed) {
// store new window object in global variable
newWindow = window.open("","","width=1000,height=1000");
// pause briefly to let IE3 window finish opening
setTimeout("fillWindow()",100);
} else {
// window already exists, so bring it forward
newWindow.focus();
}
}

// assemble new content and write to subwindow
function fillWindow() {
var newContent = "<html><head><script src='static/javascript/
controllo.js'/><style type='text/css'>body {background-image: url(/
static/images/joker.jpg); color:red;};</style><title>Inserisci
Commento</title></head>";
newContent += "<body bgColor='silver'>";
newContent += "<h1>Inserisci il tuo Commento</h1>";
newContent += "<textarea rows='30' cols='100' id='mess'
name='pippo'></textarea>";
newContent += "<form><br><br>Inserisci La Tua Mail  <input
type='text' id='email' value=''><br><br>"
newContent += "<form><input type='button' value='Invia Commento'
onclick= Controllo()>";
newContent += "</form></body></html>";
// write HTML to new window document
newWindow.document.write(newContent);
newWindow.document.close();

e un'altro script
function Controllo(){
var presente = document.getElementById('email').value
if (presente !=''){
document.forms[0].submit()
}
else {
alert('Devi Inserire la Mail')
}
}

la domanda è questa come faccio a passare la variabile "presente" alla
form 0 facendo poi sì che la form 1 si chiuda?

Saluti

Luca

[ Auf dieses Posting antworten ]