|
-
Feb 13th, 2003, 08:39 PM
#1
Thread Starter
Junior Member
Couple Javascript/HTML questions (NEED HELP URGENT!!!)
OK, the first problem is I need to know how to pop up a dynamic window that says “CUSTOMER_NAME, would you like to buy a toupee with your Rogaine purchase. It’s only $5.99—for a limited time.”
The original code is
<form name=”formsAreCool” onsubmit=”return runJavascript();”>
…
<input type=”hidden” name=”nameToShow” value=”Bob”>
…
<input type=”submit”>
</form>
The code I tried:
<HEAD>
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=1,resizable=1,width=300,height=300');");
}
// End -->
</script>
</HEAD>
<BODY>
<BODY onLoad="javascript opUp('“CUSTOMER_NAME, would you like to buy a toupee with your Rogaine purchase. It’s only $5.99—for a limited time.” ')">
</BODY>
</HTML
gave me an error in IE (-900 somethin)
--------------------------------------------------------
SECOND, I need a Javascript alert box that says:
“NAME_FROM_FORM, thank you for the following comments:
****comments****
Your input is appreciated.”
from the HTML code:
<tr><td align=right><font CLASS="bodytext"><b>Name:</b></font></td><td><input NAME="Name" TYPE="Text" SIZE="50"></td></tr>
<tr><td align=right><font CLASS=”bodytext”><b>E-Mail Address:</b></font></td><td><input NAME=email” TYPE=”Text” SIZE=”50”></td></tr>
<tr><td align=right><font CLASS=”bodytext><b>Comments:</b></font></td><td><input NAME=”comments” Type=”Text” SIZE=”100”></td></tr>
that I wrote.
Your help would be GREATLY appreciated. Thanks in advance.
-
Feb 14th, 2003, 12:56 AM
#2
Thread Starter
Junior Member
I need help.
-
Feb 18th, 2003, 08:18 PM
#3
Lively Member
you had nested <body> tags, for some reason...
you shouldnt name things with keywords like name or function or var or things like that...
you only need javascript: in href, look around threads if you're confused...
it might also help to put all your script in the <head> tag. its a personal preference. i just think it keeps things more organized...
<head>
<script...>
function doPopup()
{
withRug = confirm(document.formsarecool.custName.value+", would you like to buy a toupee with your Rogaine purchase? It’s only $5.99—for a limited time.");
alert(document.formsarecool.custName.value+", thank you for the following comments:\n"+document.formsarecool.comments.value);
}
</script>
</head>
<BODY>
<tr><td align=right><font CLASS="bodytext"><b>Name:</b></font></td><td><input NAME="custName" TYPE="Text" SIZE="50"></td></tr>
<tr><td align=right><font CLASS=”bodytext”><b>E-Mail Address:</b></font></td><td><input NAME="email” TYPE=”Text” SIZE=”50”></td></tr>
<tr><td align=right><font CLASS=”bodytext><b>Comments:</b></font></td><td><input NAME=”comments” Type=”Text” SIZE=”100”></td></tr>
<tr><td align=right><input type=button value="Continue" onClick="doPopup()">
if you choose not to decide you still have made a choice!
RUSH rocks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|