OK, I need to do three different things.
On the ONLOAD event I would like a popup box to open. In this popup
box I need two text boxes. One for the UserName and one for the
BillingTo name. After entering these two items the user can either hit
the enter key or press the submit button. The popup window will close
and then those two text boxes in the original webpage will be filled in
automatically.
I would like to have the two fields to be validated so the popup won't
close until both text boxes are filled in.
So far I have used the function from javascript.inte rnet.com in the
header of the original page. I have tried to make so that when the
first popup closes the second popup will open. I can get the variables
to pass the main page but I feel it would be more effecient to have
both text boxes in the same popup instead of having two.
<html>
<head>
<SCRIPT LANGUAGE="JavaS cript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function explain(name, output) {
newwin = window.open('', '','top=150,lef t=150,width=325 ,height=300');
if (!newwin.opener ) newwin.opener = self;
with (newwin.documen t)
{
open();
write('<html>') ;
write('<body onLoad="documen t.form.box.focu s()"><form name=form
onSubmit=window .close()> <br>');
write('<p>' + name + ' ');
write('<p><cent er> Sender: <input type=text name=box size=20
onKeyUp=' + output + '=this.value>') ;
write('<p><inpu t type=button value="Click to close when finished"
onClick=window. close()>');
write('</center></form></body></html>');
close();
}
}
// End -->
<!-- Begin
function billingto(name, output) {
newwin = window.open('', '','top=150,lef t=150,width=325 ,height=300');
if (!newwin.opener ) newwin.opener = self;
with (newwin.documen t)
{
open();
write('<html>') ;
write('<body onLoad="documen t.form.box.focu s()"><form name=form
onSubmit=window .close()> <br>');
write('<p>' + name + ' ');
write('<p><cent er> Sender: <input type=text name=box size=20
onKeyUp=' + output + '=this.value>') ;
write('<p><inpu t type=button value="Click to close when finished"
onClick=window. close()>');
write('</center></form></body></html>');
close();
}
}
// End -->
</script>
</head>
<body ONLOAD="explain ('Please enter the name of the person sending this
shipment here and it will be copied into the form for you.',
'opener.documen t.form.username .value');">
<center>
<form name=form method=post>
User Name: <input type=text name="username" size=10
onfocus="billin gto('Please enter the billing to person',
'opener.documen t.form.billing. value');">
<br>
Password: <input type=text name="billing" size=10>
</form>
</center>
</BODY>
</html>
Thanks for any help - Billy