Cali
10-07-2006, 09:41 PM
Hi,
I'm trying to code a variable with a 'window.promt'. When the result is null, the window changes to page 2. When the 'window.promt' contains a value, I would like this value to be inserted into a DIV tag of page 1 (with 'window.document.getElementById("boucle").innerHTML' ? )
Can anyone help me with writing a function that will make the 'window.promt' appear and the result go into the DIV tag? What I have so far is the variable and the promt. What I can't get is the DIV part. See below:
var name;
namePrompt = window.prompt("Please state your name");
if ( (namePrompt == "") || (namePrompt == null) )
{
namePrompt = window.location.href = "page2.htm";
}
else
{
window.document.write("Hello " + namePrompt);
}
Thank you...
I'm trying to code a variable with a 'window.promt'. When the result is null, the window changes to page 2. When the 'window.promt' contains a value, I would like this value to be inserted into a DIV tag of page 1 (with 'window.document.getElementById("boucle").innerHTML' ? )
Can anyone help me with writing a function that will make the 'window.promt' appear and the result go into the DIV tag? What I have so far is the variable and the promt. What I can't get is the DIV part. See below:
var name;
namePrompt = window.prompt("Please state your name");
if ( (namePrompt == "") || (namePrompt == null) )
{
namePrompt = window.location.href = "page2.htm";
}
else
{
window.document.write("Hello " + namePrompt);
}
Thank you...