Missing semi-colon ?

liunx

Guest
I have taken over the job of administrating a web site. I didn't create the pages, but I get to add new ones and update the existing ones. I have a page that utilizes a form for people to join a forum. For some reason the submit does not work for Netscape 7 and Compuserve 7.0 . I used Dreamweaver MX to debug this page. It says that a semi-colon was expected on the form declaration line. The line that starts: < Form action=.....><br />
<br />
As far as I can tell, no ; needs to be there. <br />
<br />
The web page is:<br />
<br />
<!-- w --><a class="postlink" href="http://www.fihs.net/join.htm">www.fihs.net/join.htm</a><!-- w --><br />
<br />
Please look at the source code and let me know what I have wrong.<br />
<br />
<br />
JohnW<!--content--><FORM action="http://www.response-o-matic.com/cgi-bin/rom.pl" target="_parent" method="POST" onsubmit="Join FIHS Racing League" name="Join"><br />
<br />
Your parser is expecting the value of the ONSUBMIT attribute to be JavaScript, which would seem to require a semi colon or two. Remove the bold part to fix that problem. And see <!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.fihs.net%2Fjoin.htm&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional&ss=1&verbose=1">http://validator.w3.org/check?uri=http% ... &verbose=1</a><!-- m --> for a list of some more errors on that page.<!--content-->Thanks for the error detection..<br />
<br />
Since I didn't write the code, I have tried to figure out what this does. When you press "submit" and the CGI replies, the page is changed to a "You registration was successfull..." sort of thing. I've always wondered if the " onSubmit= " controlled that or not. Does this tag always expect a javascript action ? Would this cause Netscape 7 and Compuserve 7.0 not to work with this page, but all other browsers to work ?<br />
<br />
I'll run the validator to see what other surprises I have.<br />
<br />
<br />
JohnW<!--content-->See <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/interact/forms.html">http://www.w3.org/TR/html4/interact/forms.html</a><!-- m --> for the low down on using forms. The ACTION attribute controls where the form information is sent on a 'submit'. The value of the ONSUBMIT attribute is a script that is called just before the form is submitted if and only if the user uses the scripting language. If the script returns 'false' then the form is not submitted, which makes the handler useful for form validation. It will not work for a good number of users so you still need back up validation at the server, but it eliminates a good bit of internet traffic nonetheless.<!--content-->Does this validator work OK with javascript ? It seems a LOT of the errors it finds are in js stuff. <br />
<br />
JohnW<!--content-->The validator ignors JavaScript; those are all HTML errors.<!--content-->OUCH!<br />
<br />
The errors seem to be within script tags. Could a misplaced ">" make the validator scan through a script section, thinking it should be HTML ? <br />
<br />
I had know idea that browsers were so forgiving of errors.<br />
<br />
<br />
Do I need to go shopping at OReilly.com ?<br />
<br />
<br />
JohnW<!--content-->Are we talking about the same page and the same validator? <!-- m --><a class="postlink" href="Seehttp://validator.w3.org/check?uri=http%3A%2F%2Fwww.fihs.net%2Fjoin.htm&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional&ss=1&verbose=1">Seehttp://validator.w3.org/check?uri=ht ... &verbose=1</a><!-- m -->. And see my first post in the thread <!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=128">http://forums.webdeveloper.com/showthre ... readid=128</a><!-- m --> for some good links.<!--content-->Yes. That's the page. After reviewing the errors, it seems than they are mostly in calls to javascript code or the initial line of a javascript declaration. I'll do some more home work.<br />
<br />
<br />
JohnW<!--content-->That "initial line of a javascript declaration" is HTML and is required to look like<br />
<br />
<script type="text/javascript"><br />
<br />
And not a single error flagged has anything to do with the JavaScript; they're all about missing or proprietary attributes.<!--content-->Don't know if you updated the page but all the errors I get with the validator are HTML errors<br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.fihs.net%2Fjoin.htm&charset=%28detect+automatically%29&doctype=HTML+4.01+Strict&verbose=1">http://validator.w3.org/check?uri=http% ... &verbose=1</a><!-- m --><br />
<br />
BTW, you are also missing a DOCTYPE on your page, eg like this<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br />
<html><br />
...<!--content-->I noticed that as well. <br />
<br />
This hand me down web site will be a chance for me to learn a lot more about web page coding. <br />
<br />
I did remove the onsubmit= section and it runs fine in Netscape 7 now. Thanks for the suggestion. Now to figure out the correct way to do all the things that make the validator mad.<br />
<br />
<br />
JohnW<!--content-->Originally posted by JohnW <br />
Now to figure out the correct way to do all the things that make the validator mad.<br />
<br />
<br />
A good hint.<br />
Work from the top and fix the things one by one and revalidate as you go.<br />
Sometimes a previous error on a page give some pretty funky errors in sections that are themselfs not broken.<!--content-->
 
Back
Top