|
| |
|
|
Reflect
Posts: 4769 From: USA Status: offline
|
RE: A bit of coding/script help required - 8/21/2004 13:13:34
What errors does the validation kick out? Take care, Brian
_____________________________
|
|
|
|
Taz
Posts: 2863 Joined: 7/6/2004 From: U.K (Formerly outer space.) Status: offline
|
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.)
< Message edited by Taz -- 8/21/2004 14:26:55 >
_____________________________
Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
|
|
|
|
d a v e
Posts: 4142 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: A bit of coding/script help required - 8/21/2004 13:41:50
<script language="JavaScript" type="text/JavaScript"> is the first one, not sure about the other 2 yet
_____________________________
David Prescott Gekko web design
|
|
|
|
Giomanach
Posts: 6115 Joined: 11/19/2003 From: England Status: offline
|
RE: A bit of coding/script help required - 8/21/2004 14:01:27
<form name="which" action=""> Dan
_____________________________
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/23/2004 8:14:38
try action="self"?
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/23/2004 11:35:34
quote:
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). change the heading from "strict" to "Transitional"?
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/23/2004 14:50:04
I took your code from your page and added this: <form name="Which" action="post"> and it still worked for me. hope this works for you
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/23/2004 15:05:08
Thanks. chocolate chip? number 3 the "w" is capitalized. Try changing that to lower case
|
|
|
|
d a v e
Posts: 4142 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: A bit of coding/script help required - 8/24/2004 1:13:09
it might be that you need to change 'name' to 'id' http://www.w3.org/TR/html401/interact/forms.html#edef-FORM quote:
name = cdata [CI] This attribute names the element so that it may be referred to from style sheets or scripts. Note. This attribute has been included for backwards compatibility. Applications should use the id attribute to identify elements.
_____________________________
David Prescott Gekko web design
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/24/2004 10:00:51
notice in the script all the W's are capitalized? change all the capital w's to lower case that is in the code within the script tags. and then you can change the name of the form to a lower case. this also works for me
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/24/2004 12:16:50
would <a name="which"> work? it does here but dont know if it validates here is the complete code : <form name="which" action="post"> <p>Smiley URL <a name="which"> <input type="text" size="60" name="where" action="post"></a> <a href="#" onClick="clearAddress()"> Clear the URL. </a>
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/25/2004 9:04:35
cool. glad you got it resolved. COOKIE FOR YOU
|
|
|
|
reric
Posts: 105 Joined: 4/28/2004 Status: offline
|
RE: A bit of coding/script help required - 8/26/2004 8:29:38
Your quite welcome and because of your post I got into validating and received my first html 4.01 validation yesterday for a plate I am working on so thank you. ERic
|
|
|
|
d a v e
Posts: 4142 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: A bit of coding/script help required - 8/26/2004 8:33:52
quote:
ORIGINAL: reric Your quite welcome and because of your post I got into validating and received my first html 4.01 validation yesterday for a plate I am working on so thank you. ERic where did you go to get your plate validated ;)
_____________________________
David Prescott Gekko web design
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|