|
Post by shedhed on Apr 1, 2008 16:02:07 GMT -5
I'm trying to validate my Greymatter stuff to XHTML 1.0 (Strict) as I like the green bar you get when you do so! When I try to validate an archive page I'm down to one error that points to:- "there is no attribute "name". method="post" name="newcomment" ---- which is in the entrycommentsform template and something to do with the cgi-bin/gm-comments.cgi#comments" method="post" name="newcomment" bit Any ideas on how to fix this? I'm a total Greymatter novice and XHTML/HTML novice too so forgive me if it's a daft question. I have to add that I'm chuffed to mintballs with how Greymatter works for me and is so flexible - just wish I knew what I was doing! Below is a link to a page that exhibits this validation problem. Thanks in advance.... www.rhodieridgeback.com/logs/archives/00000005.html
|
|
|
Post by shedhed on Apr 1, 2008 16:16:11 GMT -5
PS - I'm using GM 1.8.1 - my web host has perl 5.6.1. My pc is XP Pro.
|
|
|
Post by coldstone on Apr 1, 2008 17:19:34 GMT -5
Good catch. I think the 'name' attribute is a holdover from Html 4. I tried doing a test and if you change that 'name' to 'id', I think it will validate as xhtml and all the javascript should work.
Write back if there are any issues or it works out. But basically you would just change:
method="post" name="newcomment" ...
to:
method="post" id="newcomment" ...
|
|
|
Post by shedhed on Apr 2, 2008 1:45:37 GMT -5
Thanks for the reply - I had tried the change from name to id and the page then validates but then the emoticons don't work.
If I click on a smilie the following error is displayed in Firebug:-
document.newcomment has no properties
Unfortunately this is beyond me so I can't unravel the problem any further.
I do appreciate your help. Thanks - Andy
|
|
|
Post by coldstone on Apr 3, 2008 18:03:29 GMT -5
Thats weird. I actually used Firebug to change the name/id and it still worked yesterday. If you make the change, I can take a look. You would only want to change the name to id in the form tag.
|
|
|
Post by shedhed on Apr 9, 2008 8:21:05 GMT -5
Sorry for delay - out of the country.
I tried the change in Firebug and it carries on working as you say - but - if you change "name" to "id" in the entrycommentsform template and rebuild and refresh then it stops.
I've left it as "id" so if you do get a chance to take a look I'd appreciate it.
I wasn't exactly sure what you meant by "You would only want to change the name to id in the form tag." I assume that this is just the <form action= "{{cgiwebpath}}/gm-comments.cgi#comments" method="post" name="newcomment"> bit in the entrycommentsform.
Many thanks, Andy
|
|
|
Post by coldstone on Apr 14, 2008 23:02:48 GMT -5
Hi Andy, I am looking into this. I did notice that you are using strict for the DTD. I think if you loosen that up it will validate. But I think there should be a way to validate the page with strict also.
*Update* Ok, not sure if this will validate any better, but this will work for the javascript. Change and instance of "document.newcomment" to "document.forms[0]".
This will work, however, its fragile as the javascript is always assuming that your comment form is the first html form on the page. So, something to watch out for when you modify your templates.
Ideally, it would be nice to have a standard Greymatter javascript library, that could be refactored (one day) to use the js function 'getElementById'. I think that is the cleaner and more popular way to get elements to modify.
|
|
|
Post by shedhed on Apr 15, 2008 14:41:19 GMT -5
Thanks for your help - that sorted out the smilies and they're now working again plus the page validates.
Firebug does throw up one error:-
document.newcomment has no properties document.newcomment.newcommentauthor.value = getCookie("gmcmtauth")
I don't know enough about javascript (correction; I know nothing about javascript) so don't know if this is relevant. This is the danger of something like Firebug in the hands of people like me who like green ticks as opposed to red crosses.
I must add that I'm grateful for your support and I appreciate the time and considerable effort you put into helping others like me.
Andy
|
|
|
Post by coldstone on Apr 15, 2008 22:44:11 GMT -5
No problem. Basically, there are several places where you want to replace "newcomment" with "forms[0]". You can view the source of your page and see where there are instances of "newcomment". Firebug is correct, in that the javascript to read stored values from the users cookies won't work.
I think there is a template for the cookie code. Otherwise if you just goto edit the templates search for the "document.newcomment" you should find everywhere you need to change.
|
|
|
Post by shedhed on Apr 16, 2008 1:37:52 GMT -5
Yes - I'd missed changing one of the templates so that did the job. Many thanks.
Andy
|
|