|
Taz -> RE: A bit of coding/script help required (8/21/2004 13:31:23)
|
I get 3 errors.... Line 16, column 29: required attribute "TYPE" not specified <script language="JavaScript"> The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element. Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>. Line 73, column 11: there is no attribute "NAME" <form name="Which"> You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. Line 73, column 18: required attribute "ACTION" not specified <form name="Which"> As all 3 are relating to the script I don't know what to change so the script still functions. Here is the script/ INSTRUCTIONS:
Step One: The Script
---------------------
Paste the following script into the <head> ... </head> of
your page. There are no script set-ups needed.
<script language="JavaScript" type="text/JavaScript">
// Script Source: CodeLifter.com
// Copyright 2002
// Do not remove this notice
var isReady = false;
function showAddress(What){
if (isReady){
document.Which.Where.value = What;
document.Which.Where.focus();
document.Which.Where.select();
}else{
alert("This page is not fully loaded yet...\nPlease wait for the page to finish loading.");
}
}
function clearAddress(){
if (isReady){
document.Which.Where.value = '';
}else{
alert("This page is not fully loaded yet...\nPlease wait for the page to finish loading.");
}
}
</script>
Step Two: The Body Tag Onload Event
------------------------------------
Add onload="isReady=true" to your body tag, as shown below.
This is necessary to prevent false object calls prior to
the page being fully loaded. Thus:
<body onload="isReady=true">
Step Three: The TextBox
-------------------------
Insert the following code for the text box in your page. (It
may be anywhere in your page.) Do not change the form or
field names.
<form name="Which">
<input type="text" size="60" name="Where">
</form>
To clear the textbox from a link in the page, use this:
<a href="#" onClick="clearAddress()">
Clear
</a>
Step Four: Attaching To The Images
-----------------------------------
You may attach the script to as many images as you wish. To
attach to the image add onMouseDown="showAddress(this.src)"
to the img src tag, as shown in the sample below.
Simple code
<img src="http://ganjataz.com/Forum/images/smiles/smileybanner.jpg"
onMouseDown="showAddress(this.src)"> Cheers. Edited so the full script & instructions are included (Forgot to add that from all the headbanging on the desk.)
|
|
|
|