Doc type for dummies;)

Page: 1

Author Post
Member
Registered: Nov 2009
Posts: 22
Well I've been happier than #$!@ with my new floatbox! Looks great, works great. Then I ran into a little "snag". My hosted cart has an issue with the one-page checkout and the recommended doc type for floatbox. It causes an error where it thinks the state and country are invalid. Don't know why, but it is a documented issue in the cart's forums as well. The original doc type for the cart that works with the checkout page is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Can someone tell me what part of that makes it "quirks mode" and is it possible that I can elimiate that one part of the code above so perhaps floatbox and checkout will play nice together?
Administrator
Registered: Aug 2008
Posts: 3382
Don't know for sure if this is enough to push some browsers into quirks mode, but that DOCTYPE declaration is missing its dtd reference. The complete 4.01 transitional declaration is:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/color]

There could be other reasons for quirks mode. If you have any text appearing before your doctype, that will throw some browsers into quirks mode.

I like the simplest html5 doctype the best. It puts all browsers into standards mode and its hard to get the syntax wrong. And contrary to popular belief, the different doctypes do not change how browsers parse or render a page. It only changes what standard a validator will use when checking your page.[color=maroon]
<!DOCTYPE html>
Member
Registered: Nov 2009
Posts: 22
Ok, here is what i did. I added that dtd reference, and it makes the error happen in the checkout. I removed it, and the error when away. SO, it appears the dtd reference is what is causing the error during checkout, but does that dtd reference effect floatbox? I guess what I am asking is does the first line of code (without the 2nd line dtd reference) give floatbox what it needs to render properly so I could "hack" out the quirks mode check or without that dtd reference would floatbox have rendering problems?
Administrator
Registered: Aug 2008
Posts: 3382
It sounds like your page needs to run in quirks mode in order to operate correctly. In which case, it is incompatible with floatbox. Floatbox needs to run in standards mode. There's no point hacking out the quirks mode check. Floatbox will not render correctly on a page in quirks mode. The check is there for a reason. You will need to either figure out how to make that page not throw an error in standards mode or resign yourself to not using floatbox with that page. Not the answer you were hoping for, I'm sure.
Member
Registered: Nov 2009
Posts: 22
Well that's not acceptable. I like floatbox more than the cart! I'll put preasure on the cart people to see if they can fix. I don't know why a checkout page needs to "render" in quirks mode to work right. There must be SOME standard that their asp code uses, perhaps I can find out what it is a use that standard in the doc type. I'll post back if I get a fix from them:)
Administrator
Registered: Aug 2008
Posts: 3382
I like your determination.
If you want to show me an online example of the troublesome cart page, I'll take a quick look to see if I can figure what it doesn't like about standards.
Member
Registered: Nov 2009
Posts: 22
Sure, that'd be great. It's not live yet so you have to use the subdomain:

designedgifts.3dcartstores.com

Just add anything to cart and checkout, use the money order for payment and when you click the complete button you'll see an error about billing state and country.
Member
Registered: Nov 2009
Posts: 22
Forgot to mention, error is in IE8, not firefox.
Administrator
Registered: Aug 2008
Posts: 3382
I took a look but I can't help you. There's no error being thrown to look into. It's just that the form validation routines are not correct. Off to the cart people you go. :)
Member
Registered: Nov 2009
Posts: 22
I appreciate you looking into it for me. I've logged a ticket with them. Should be able to get it resolved. Floatbox rox!
Member
Registered: Nov 2009
Posts: 22
Follow up:

I was looking through the docs and noticed your reference to setting IE8 to IE7 mode with a meta tag. Low-and-behold, all is well now:)!! Cart and floatbox play nice together. Thanks for helping me with this, I really appreciate your personal attention. When I go to register I'll message you how to "add" some to your purchase price, you really deserve more than you're asking for.

Page: 1