navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

A bit of coding/script help required

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> A bit of coding/script help required
Page: [1] 2   next >   >>
 
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
A bit of coding/script help required - 8/21/2004 10:43:21   
I need a little help getting this page to validate.
(Or find a work around/new script that does what this one does but doesn't set the W3C validator alarm bells ringing.)

http://ganjataz.com/smileys/1-index.htm


As you can see if you check the code source, I am using a script created by someone else, & it is kicking up errors when validated. Sadly I am no good at scripting so coding my own script is out, but this script does exactly what I want (Minus the errors it generates of course).

Anyone got any ideas or can offer help, it would be greatly appreciated as my desk is getting a tad annoyed with me banging my head against it. :)

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)
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

_____________________________


(in reply to Taz)
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.
:)

(in reply to Reflect)
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

(in reply to Taz)
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:49:46   
w00t! :)

One down, 2 to go!

/hands you a cookie

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to d a v e)
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

_____________________________




(in reply to Taz)
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 14:20:55   
<form name="which" action="">

What would I put between the two ""

Cos just adding that code stops the script doing what it should. 0-o

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to Giomanach)
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"?

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/23/2004 11:03:21   
No joy, stops the URL showing in the form box, thus making it useless. :(

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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"?

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/23/2004 13:37:46   
"<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">"

Is what I am using.

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/23/2004 14:55:01   
HUZZAH!

2 down, 1 left!

/hands you a cookie :)

Many thanks.

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/23/2004 15:10:24   
Double choc chip. ;)

If I change the case for the W it stops the script working again *considers banging head on desk again*

"Line 73, column 11: there is no attribute "NAME"
W3C results for page/error

So close, yet so far *cries*

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/24/2004 9:29:18   
Again it stops the script working, thanks though.

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to d a v e)
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

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/24/2004 11:41:53   
Done & yes it works, but still I am left with the last error,
"Line 73, column 11: there is no attribute "NAME"

Changing that to "id" stops it working, but the page validates as compliant HTML.

:)

Great that I now have a valid page, not so great that the page does not do what it is supposed to.
(Or am I missing something?)

*mutters many swearwords at W3C*

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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>

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/24/2004 12:31:46   
Again it is the validation errors I am trying to defeat*, along with the script working.
It works but does not validate.

*Or finding an alternate work around so that my surfers can easily click on a smiley & get the URL for it in roughly the same manner as this code does.

I am fighting to get my site W3C valid & X-Broswer compliant/compatible, something I am now wishing I never bothered with. :)

Ignorance was bliss....:)

Cheers foir the time & effort though, it is appreciated.

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/24/2004 21:07:32   
Issue resolved!

A small tweak in the doc type resolved the issue. :)

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to Taz)
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

(in reply to Taz)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/25/2004 13:04:41   
Hahaha, I am glad it is now working as I want, it would have been a shame to have parts of my site uncompliant when I worked so hard getting the other areas compliant.

Thanks for the cookie, & thanks all again for the help, it really is appreciated. =]

The first part of my smiley section is now online, so please feel free to use any of my smileys.
http://ganjataz.com/smileys/menu.htm

I got a load more smileys yet to be added, but the first upload of smileys is available for posting.:)

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to reric)
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

(in reply to Taz)
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

(in reply to reric)
Donkey

 

Posts: 3893
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: A bit of coding/script help required - 8/26/2004 8:54:27   
quote:

where did you go to get your plate validated ;
I too would like to know because none of my plates have been validated and I'm worried that they may not be compliant. (They are dishwasher and microwave safe)
What about cutlery? That could be a problem; do you have to validate it for use with specific plates or is there a general standard. Should I stop using it just to be safe?

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to d a v e)
Giomanach

 

Posts: 6115
Joined: 11/19/2003
From: England
Status: offline

 
RE: A bit of coding/script help required - 8/26/2004 8:59:01   
Taz....now here's a smilie I agree with...

:)

:)

quote:

I too would like to know because none of my plates have been validated and I'm worried that they may not be compliant. (They are dishwasher and microwave safe)
What about cutlery? That could be a problem; do you have to validate it for use with specific plates or is there a general standard. Should I stop using it just to be safe?


Viewing through IE, the Window, FF or Opera?

_____________________________




(in reply to Donkey)
reric

 

Posts: 105
Joined: 4/28/2004
Status: offline

 
RE: A bit of coding/script help required - 8/26/2004 14:06:18   
hee hee you all are funny!:) Glad you all had a little laugh :)

(in reply to Giomanach)
Taz

 

Posts: 2863
Joined: 7/6/2004
From: U.K (Formerly outer space.)
Status: offline

 
RE: A bit of coding/script help required - 8/26/2004 16:42:21   
quote:

ORIGINAL: Giomanach

Taz....now here's a smilie I agree with...

:)

:)

=]
Damn skippy they do!

I was lucky enough to see them again a few months back. Met Aubrey at long last. (Bass player, tour manager & Webmaster of their site.)
Hopefully will be seeing them again later this year for the No Roots tour.

So, whats ya fave track/album?

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

Awesome. :)

_____________________________

Smiley T-Shirts and other Geeky fun stuff, Smileys and phpbb Smiley paks.
:)

(in reply to Giomanach)
Page:   [1] 2   next >   >>

All Forums >> Web Development >> General Web Development >> A bit of coding/script help required
Page: [1] 2   next >   >>
Jump to: 1





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