Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Keep getting an Error msg with "document.form.*****.value = " statements

Posted on 2004-03-25
8
Medium Priority
?
493 Views
Last Modified: 2008-03-10
Can anyone clue me in to why I'm getting an error with this? I keep getting a requested semicolon for line 7, character 13, which would put it right after the first "var document", where the period is currently located. I can't see anything wrong with the code, so hopefully one of you has the eye or knowledge of what's wrong here!

Code:

Start Line 1: <html>
<head>
<script>
var links = 'http://webmastereseller.com';
</script>
<script language="javascript">
var document.app.affilink.value = links;
var document.app.textlink.value = '<a href="' + links + '">MASSIVE Webmasters Resale Package - MASTER RESALE RIGHTS!</a>';
var document.app.banner1.value = '<a href="' + links + '"><img src="webmaster_468x60.gif" width="468" height="60" border="0"></a>';
var document.app.banner2.value = '<a href="' + links + '"><img src="resalepack_468x60.gif" width="468" height="60" border="0"></a>';
var document.app.banner3.value = '<a href="' + links + '"><img src="webmaster_125x125.gif" width="125" height="125" border="0"></a>';
var document.app.banner4.value = '<a href="' + links + '"><img src="resalepack_125x125.gif" width="125" height="125" border="0"></a>';
var document.app.banner5.value = '<a href="' + links + '"><img src="webmaster_120x240.gif" width="120" height="240" border="0"></a>';
var document.app.banner6.value = '<a href="' + links + '"><img src="webmaster_120x60.gif" width="120" height="60" border="0"></a>';
var document.app.banner7.value = '<a href="' + links + '"><img src="webmaster_88x31.gif" width="120" height="60" border="0"></a>';
return true;
</script>
</head>
<body>
<form name="app">
<input name="affilink" type=text size=100 value="">
<input name="textlink" type=text size=100 value="">
<input name="banner1" type=text size=100 value="">
<input name="banner2" type=text size=100 value="">
<input name="banner3" type=text size=100 value="">
<input name="banner4" type=text size=100 value="">
<input name="banner5" type=text size=100 value="">
<input name="banner6" type=text size=100 value="">
<input name="banner7" type=text size=100 value="">
</form>
</body>
</html>
0
Comment
Question by:ziffgone
  • 3
  • 3
  • 2
8 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 600 total points
ID: 10680887

you cannot declare a variable as "document.app.affilink.value"
this is where you are getting error.

if you want to assign value simply say

document.app.affilink.value = links;
0
 
LVL 10

Assisted Solution

by:Bustarooms
Bustarooms earned 600 total points
ID: 10680919
the problem is that you're script is being run before the form is created  

you should encapsulate that whole thing in a function and call that function on load

<html>
<head>
<script>
var links = 'http://webmastereseller.com';
</script>
<script language="javascript">
function onLoadFunction(){
var document.app.affilink.value = links;
var document.app.textlink.value = '<a href="' + links + '">MASSIVE Webmasters Resale Package - MASTER RESALE RIGHTS!</a>';
var document.app.banner1.value = '<a href="' + links + '"><img src="webmaster_468x60.gif" width="468" height="60" border="0"></a>';
var document.app.banner2.value = '<a href="' + links + '"><img src="resalepack_468x60.gif" width="468" height="60" border="0"></a>';
var document.app.banner3.value = '<a href="' + links + '"><img src="webmaster_125x125.gif" width="125" height="125" border="0"></a>';
var document.app.banner4.value = '<a href="' + links + '"><img src="resalepack_125x125.gif" width="125" height="125" border="0"></a>';
var document.app.banner5.value = '<a href="' + links + '"><img src="webmaster_120x240.gif" width="120" height="240" border="0"></a>';
var document.app.banner6.value = '<a href="' + links + '"><img src="webmaster_120x60.gif" width="120" height="60" border="0"></a>';
var document.app.banner7.value = '<a href="' + links + '"><img src="webmaster_88x31.gif" width="120" height="60" border="0"></a>';
return true;
}
</script>
</head>
<body onload="onLoadFunction();">
<form name="app">
<input name="affilink" type=text size=100 value="">
<input name="textlink" type=text size=100 value="">
<input name="banner1" type=text size=100 value="">
<input name="banner2" type=text size=100 value="">
<input name="banner3" type=text size=100 value="">
<input name="banner4" type=text size=100 value="">
<input name="banner5" type=text size=100 value="">
<input name="banner6" type=text size=100 value="">
<input name="banner7" type=text size=100 value="">
</form>
</body>
</html>
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10680939
I am not sure... but I think you want something like this

<head>
<script>
var links = 'http://webmastereseller.com';
</script>

</head>
<body>
<form name="app">
<input name="affilink" type=text size=100 value="">
<input name="textlink" type=text size=100 value="">
<input name="banner1" type=text size=100 value="">
<input name="banner2" type=text size=100 value="">
<input name="banner3" type=text size=100 value="">
<input name="banner4" type=text size=100 value="">
<input name="banner5" type=text size=100 value="">
<input name="banner6" type=text size=100 value="">
<input name="banner7" type=text size=100 value="">
</form>
<script language="javascript">
document.app.affilink.value = links;
document.app.textlink.value = '<a href="' + links + '">MASSIVE Webmasters Resale Package - MASTER RESALE RIGHTS!</a>';
document.app.banner1.value = '<a href="' + links + '"><img src="webmaster_468x60.gif" width="468" height="60" border="0"></a>';
document.app.banner2.value = '<a href="' + links + '"><img src="resalepack_468x60.gif" width="468" height="60" border="0"></a>';
document.app.banner3.value = '<a href="' + links + '"><img src="webmaster_125x125.gif" width="125" height="125" border="0"></a>';
document.app.banner4.value = '<a href="' + links + '"><img src="resalepack_125x125.gif" width="125" height="125" border="0"></a>';
document.app.banner5.value = '<a href="' + links + '"><img src="webmaster_120x240.gif" width="120" height="240" border="0"></a>';
document.app.banner6.value = '<a href="' + links + '"><img src="webmaster_120x60.gif" width="120" height="60" border="0"></a>';
document.app.banner7.value = '<a href="' + links + '"><img src="webmaster_88x31.gif" width="120" height="60" border="0"></a>';

//return true;
</script>

</body>
</html>
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10680957
or as Bustarooms said.... you can do something like this.

<html>
<head>
<script>
var links = 'http://webmastereseller.com';
</script>
<script language="javascript">
function onLoadFunction(){
document.app.affilink.value = links;
document.app.textlink.value = '<a href="' + links + '">MASSIVE Webmasters Resale Package - MASTER RESALE RIGHTS!</a>';
document.app.banner1.value = '<a href="' + links + '"><img src="webmaster_468x60.gif" width="468" height="60" border="0"></a>';
document.app.banner2.value = '<a href="' + links + '"><img src="resalepack_468x60.gif" width="468" height="60" border="0"></a>';
document.app.banner3.value = '<a href="' + links + '"><img src="webmaster_125x125.gif" width="125" height="125" border="0"></a>';
document.app.banner4.value = '<a href="' + links + '"><img src="resalepack_125x125.gif" width="125" height="125" border="0"></a>';
document.app.banner5.value = '<a href="' + links + '"><img src="webmaster_120x240.gif" width="120" height="240" border="0"></a>';
document.app.banner6.value = '<a href="' + links + '"><img src="webmaster_120x60.gif" width="120" height="60" border="0"></a>';
document.app.banner7.value = '<a href="' + links + '"><img src="webmaster_88x31.gif" width="120" height="60" border="0"></a>';
return true;
}
</script>
</head>
<body onload="onLoadFunction();">
<form name="app">
<input name="affilink" type=text size=100 value="">
<input name="textlink" type=text size=100 value="">
<input name="banner1" type=text size=100 value="">
<input name="banner2" type=text size=100 value="">
<input name="banner3" type=text size=100 value="">
<input name="banner4" type=text size=100 value="">
<input name="banner5" type=text size=100 value="">
<input name="banner6" type=text size=100 value="">
<input name="banner7" type=text size=100 value="">
</form>
</body>
</html>
0
 
LVL 14

Author Comment

by:ziffgone
ID: 10681170
Ok, this was a test script I was writing to iron out the kinks of the original. In my original script the document.app.*****.value's are located in a function as suggested. This function is only called after someone inputs their email address into a different form and is called by 'onclick="bannerCode();"'.


function bannerCode(){
if (document.both.email.value != ""){
var links = 'http://webmastereseller.com?ref=' + document.both.email.value;
}
else if (document.paypal.email.value != ""){
var links = 'http://webmastereseller.com?ref=' + document.paypal.email.value + '&pay=PayPal';
}
else if (document.stormpay.email.value != ""){
var links = 'http://webmastereseller.com?ref=' + document.paypal.email.value + '&pay=StormPay';
}
else {
alert('Please enter Your E-mail\naddress into one of the\nBoxes to receive your Links');
}
document.link.affilink.value = links;
document.link.textlink.value = '<a href="' + links + '">MASSIVE Webmasters Resale Package - MASTER RESALE RIGHTS!</a>';
document.link.banner1.value = '<a href="' + links + '"><img src="webmaster_468x60.gif" width="468" height="60" border="0"></a>';
document.link.banner2.value = '<a href="' + links + '"><img src="resalepack_468x60.gif" width="468" height="60" border="0"></a>';
document.link.banner3.value = '<a href="' + links + '"><img src="webmaster_125x125.gif" width="125" height="125" border="0"></a>';
document.link.banner4.value = '<a href="' + links + '"><img src="resalepack_125x125.gif" width="125" height="125" border="0"></a>';
document.link.banner5.value = '<a href="' + links + '"><img src="webmaster_120x240.gif" width="120" height="240" border="0"></a>';
document.link.banner6.value = '<a href="' + links + '"><img src="webmaster_120x60.gif" width="120" height="60" border="0"></a>';
document.link.banner7.value = '<a href="' + links + '"><img src="webmaster_88x31.gif" width="120" height="60" border="0"></a>';
return true;
}

I'm now coming up with a "value is null or not an object" error.
0
 
LVL 10

Expert Comment

by:Bustarooms
ID: 10681232
hard to tell, think we'll need the html that goes with the script
0
 
LVL 14

Author Comment

by:ziffgone
ID: 10681640
Here you go, I really appreciate your time and effort in this, all of you!

http://ziffgone.the.cashculture.net/bannertester/

Just "view source" when you get there.

Thanks again.
0
 
LVL 14

Author Comment

by:ziffgone
ID: 10681756
Found the last problem, it was in the email checker script. DOH!

Anyways, a GREAT BIG THANKS to venkateshwarr and Bustarooms! I increased the Question's reward points and spit them between you.

Have a great day guys!

Kind Regards,
ziffgone.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question