Form target attribute--not validating with strict doctype?

T

TheKeith

I'm putting a paypal form to buy my pictures on my website and using
paypal's automatically generated form buttons. The problem is that the form
element itself contains a target attribute, which the validator will not
validate. Is there another way I can target a new window with the name
"paypal." I don't have anything up yet to link you to, but maybe someone
here knows what I'm talking about and can help. Thanks.
 
L

Leif K-Brooks

TheKeith said:
I'm putting a paypal form to buy my pictures on my website and using
paypal's automatically generated form buttons. The problem is that the form
element itself contains a target attribute, which the validator will not
validate. Is there another way I can target a new window with the name
"paypal." I don't have anything up yet to link you to, but maybe someone
here knows what I'm talking about and can help. Thanks.

Not exactly what you want, but take a look at
http://www.sitepoint.com/article/1041.
 
D

David Dorward

Leif said:
Not exactly what you want, but take a look at
http://www.sitepoint.com/article/1041.

If you want to open links in a new window, use a Transitional Doctype.
Despite the claims of that article, that rewrites the document at runtime
to make it invalid. In effect, all its doing is hiding the invalid markup
from the validator (I call this 'cheating').
 
T

TheKeith

Leif K-Brooks said:
Not exactly what you want, but take a look at
http://www.sitepoint.com/article/1041.

well I don't really know javascript too well, but this seems to relate more
to anchor tags than forms. I emailed paypal, but they told me the target was
necessary. Tehy said they understood my frustration though :) -- who knows
maybe they'll come up with a new method, incvolving javascript, but for now,
it's either change my doctype back to transitional (even though it works
with strict--just doesn't validate), use a different shopping cart service
(impractical), or just keep researching.
 
L

Leif K-Brooks

David said:
If you want to open links in a new window, use a Transitional Doctype.
Despite the claims of that article, that rewrites the document at runtime
to make it invalid. In effect, all its doing is hiding the invalid markup
from the validator (I call this 'cheating').

Yes, and using font-size in CSS is hiding your <font> elements.
 
T

Toby A Inkster

Leif said:
Yes, and using font-size in CSS is hiding your <font> elements.

Well, if you use things like <span class="heading"> then you might as well
be using <font> elements, so in a way, yes!

The method in question is rather cheating. Consider:

<script type="text/javascript">
document.write("<mar" + "quee>Scrolling text<\/marq" + "uee>");
</script>
 
D

David Dorward

Leif said:
Yes, and using font-size in CSS is hiding your <font> elements.

No it isn't.

There is a significant difference between altering a document at run time,
and applying a style sheet to one.
 
L

Leif K-Brooks

David said:
There is a significant difference between altering a document at run time,
and applying a style sheet to one.

Which is exactly my point. If it was using document.write('<form
target="...">') or form.setAttribute('target', '...'), then I would
agree with you. The DOM target property on the other hand is unrelated
to the (X)HTML target attribute, and is still in DOM2. Javascript is for
effects, just like CSS is for presentation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top