The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Common Scripting Events code not operational
djolenene
post Sep 4 2008, 06:56 PM
Post #1


Newbie
*

Group: Members
Posts: 11
Joined: 25-July 08
From: Manchester, UK
Member No.: 6,266



Hi, My name is Dorde, I'm studying HTML for couple of months from htmlhelp.com and usually tested the code examples I was given, as I came to common scripting events on common attributes page, and tested the code <INPUT TYPE=submit ONMOUSEOVER='window.status="Did you fill in all required fields?";' ONMOUSEOUT='window.status="";'> with following meta element <META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript"> what I just copy and paste it, and realized that code is not working. Can anyone tell me what I did wrong. Thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 4 2008, 07:06 PM
Post #2


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



What browser?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
djolenene
post Sep 4 2008, 07:11 PM
Post #3


Newbie
*

Group: Members
Posts: 11
Joined: 25-July 08
From: Manchester, UK
Member No.: 6,266



IE7, Flock 1.2.5, Crazy Browser 2.0, Firefox 3.01, Maxton 2, Netscape 9,
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 4 2008, 07:18 PM
Post #4


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



You haven't disabled JS in all of them, have you? happy.gif

Honest, it works. Can you paste the whole test page in here? Must be something odd with it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 5 2008, 05:10 AM
Post #5


.
********

Group: WDG Moderators
Posts: 8,548
Joined: 10-August 06
Member No.: 7



Many browsers let the user stop javascript from changing the status bar, even if JS is enabled.

In any case there should be more effective ways to check that form fields are filled in: http://htmlhelp.com/faq/html/forms.html#required-fields

Regarding the META element, http://www.w3.org/TR/html401/interact/scri...#default-script says

"Documents that do not specify default scripting language information and that contain elements that specify an intrinsic event script are incorrect."


but *cough* I've never ever used such a Meta element, and have never received any validator errors due to this. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 5 2008, 10:49 AM
Post #6


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



Hey, the guy is learning. It isn't about the best, it's about understanding how basic things work. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 5 2008, 02:14 PM
Post #7


.
********

Group: WDG Moderators
Posts: 8,548
Joined: 10-August 06
Member No.: 7



But I want to know myself! sad.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 5 2008, 02:21 PM
Post #8


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



Know what? wacko.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 5 2008, 04:17 PM
Post #9


.
********

Group: WDG Moderators
Posts: 8,548
Joined: 10-August 06
Member No.: 7



If (as my W3C quote suggests)

CODE
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">


(or the equivalent Http header) is required with inline JS, and if so why the validators don't complain, and why AFAIK nobody else (among those writing valid HTML) seem to use it (but I haven't checked other people's headers).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 5 2008, 04:25 PM
Post #10


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



QUOTE
why the validators don't complain

Bacause they don't care about either JS or Meta tags, as long as they don't break any syntax rules, I suppose. unsure.gif



CODE
, and why AFAIK nobody else (among those writing valid HTML) seem to use it (but I haven't checked other people's headers).

I use the HTTP header and I feel extremely cool because I do. cool.gif

Browsers of course don't care either way. They assume JS if nothing else is stated. Not much else it could be anyway, more than in IE.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
djolenene
post Sep 5 2008, 05:27 PM
Post #11


Newbie
*

Group: Members
Posts: 11
Joined: 25-July 08
From: Manchester, UK
Member No.: 6,266



Hi, I did not turn of JS, its on on every browser.
You will notice that my dreamweaver has inserted forward slash at the end of script probably because DTD is XHTML, but I tried without, and make no difference, this test page is mix of HTML and XHTML, maybe there the problem is.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META http-equiv="Content-Style-Type" content="text/css">

<title></title>

</head>
<body>
<FORM>

<FIELDSET>
<LEGEND ACCESSKEY=C>Credit Card Information<BR /></LEGEND>
<P>
<LABEL ACCESSKEY=V>
<INPUT TYPE=radio NAME=card VALUE=visa /> Visa
</LABEL>
<LABEL ACCESSKEY=M>
<INPUT TYPE=radio NAME=card VALUE=mc /> MasterCard
</LABEL>
<BR />
<LABEL ACCESSKEY=N>
Number: <INPUT TYPE=text NAME=number />
</LABEL>
<LABEL ACCESSKEY=E>
Expiry: <INPUT TYPE=text NAME=expiry />
</LABEL>
</P>
</FIELDSET>

<P>
<INPUT TYPE=submit ONMOUSEOVER='window.status="Did you fill in all required fields?";' ONMOUSEOUT='window.status="";' />
</P>

<ADDRESS>
If you have any questions about ordering, contact us at
<A HREF="mailto:orders@example.com">orders@example.com</A>,
or phone our offices at 555-5555.
</ADDRESS>

</FORM>
</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 5 2008, 05:43 PM
Post #12


Computer says no.
********

Group: WDG Moderators
Posts: 19,110
Joined: 9-August 06
Member No.: 6



QUOTE(djolenene @ Sep 6 2008, 12:27 AM) *

You will notice that my dreamweaver has inserted forward slash at the end of script

What script? It should have put slashes at the end of the meta tags and kept all element and attribute names lower case though, as that's an requirement in XHTML. But do you really have a reason to use XHTML?

I see nothing wrong with it otherwise and the mouseover works in the browsers I tried. Are you sure JS works at all for you locally? Windows may prevent it from running, but you should get a warning then and it should only affect IE. Could it be you have some other program that "protects" you from JS? blink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 5 2008, 05:47 PM
Post #13


.
********

Group: WDG Moderators
Posts: 8,548
Joined: 10-August 06
Member No.: 7



Check your browser settings. E.g., in IE7 there's an entry under Internet Options > Security > Internet > Custom settings called "Allow status field to be updated by scripts" or similar. Note that this setting can be different for various security zones.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
djolenene
post Sep 5 2008, 06:17 PM
Post #14


Newbie
*

Group: Members
Posts: 11
Joined: 25-July 08
From: Manchester, UK
Member No.: 6,266



No there is nothing blocking JS, tel you how I know, yesterday I paste the same code twice into same page, and had two buttons with small gap between them, and I previewed page in IE, and by accident put mouse arrow in between two same buttons, and it worked, but only with arrow in between, when I moved arrow on button, message was gone.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
djolenene
post Sep 5 2008, 06:32 PM
Post #15


Newbie
*

Group: Members
Posts: 11
Joined: 25-July 08
From: Manchester, UK
Member No.: 6,266



There might be problem with my computer, I think I should continue with learning, and later when I have more knowledge, experiment with it again.
Thanks for your help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th September 2020 - 04:07 PM