This questions haunts me. I want my page compatible with xhtml, but the lack of <form target="... makes dynamic content very limited. has another technology solved this problem or we're stuck to xhtml 1.0 transitional for now?

    Well, the first question to address is, why is the target attribute deprecated? The basic answer is that it was decided that web developers should not force unsolicited new windows on users. Is there a real use case in your application for having a form submission force a new window on the user?

    If there is a good reason, then there is nothing wrong with using a transitional doctype. There are "tricks" you can use to have JavaScript add the target attribute via DOM manipulation so that the page will pass the w3c validator, but then why bother with that extra processing when you can just use a transitional doctype and save the extra download time and processing? (And if the user has JavaScript disabled, then it won't work, anyway.)

    Another option might be to use CSS to create simulated windows. You could have the form call the same page, and when it processes the form it outputs the results into a DIV or other block element that is absolutely positioned with a z-index to place it over the rest of the page. A little simple JavaScript can be used to change its display to "hidden" as the action for a "close window" button or link.

      Write a Reply...