• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

PHP/HTML STRICT SELECT, how to do it correct.

Junior Spellweaver
Joined
Nov 15, 2009
Messages
106
Reaction score
1
Hello guys, im currently trying to get my page validated as xHtml strict. i get this error.
error - PHP/HTML STRICT SELECT, how to do it correct. - RaGEZONE Forums

when i make the select inside a table it works, but the position of the select is moved, how can i make it valid without moving the select box position on the page? Thanks!
 

Attachments

You must be registered for see attachments list
Joined
Jun 8, 2007
Messages
1,985
Reaction score
490
There are inline elements and there are block elements. The is an inline element. You are allowed to place the SELECT element inside of "any element that supports phrasing content",
( ).​

For example the DIV and P tags are only allowed in flow content. The SPAN tag is allowed inside flow content- and also phrasing content. The and tags support where a only supports . Easy, right? Always use a reference.

One Suggestion:
Try wrapping the SELECT tag in P or SPAN tags because they are allowed inside elements that only support flow content, but both also support phasing content- which is what a SELECT menu is categorized as.


These rules may seem silly at first glance, but it's very easy to see why they are necessary. You cannot have inline elements simply floating about the page where ever you want to place them. For example, there is no reason to wrap a block-level element inside of a <strong> tag because block-level elements are not text. Similarly, rarely do you ever want text floating about inside of the <body> tag without any

Please read this for more information:
 
Last edited:
Junior Spellweaver
Joined
Nov 15, 2009
Messages
106
Reaction score
1
There are inline elements and there are block elements. The is an inline element. You are allowed to place the SELECT element inside of "any element that supports phrasing content",
( ).​

For example the DIV and P tags are only allowed in flow content. The SPAN tag is allowed inside flow content- and also phrasing content. The and tags support where a only supports . Easy, right? Always use a reference.

One Suggestion:
Try wrapping the SELECT tag in P or SPAN tags because they are allowed inside elements that only support flow content, but both also support phasing content- which is what a SELECT menu is categorized as.


These rules may seem silly at first glance, but it's very easy to see why they are necessary. You cannot have inline elements simply floating about the page where ever you want to place them. For example, there is no reason to wrap a block-level element inside of a <strong> tag because block-level elements are not text. Similarly, rarely do you ever want text floating about inside of the <body> tag without any

Please read this for more information:

Code:
<?php if (!$current_id){?><form action='' method='post' id="language"><select name="lang" onchange="document.forms['language'].submit()">
<option value="english"<?php if ($_SESSION['language']=="english") {echo "selected='selected'";}?>>English</option>
<option value="svenska"<?php if ($_SESSION['language']=="svenska") {echo "selected='selected'";}?>>Svenska</option>
</select></form><?php;}?>

thats my code for this select problem, if i put <span> before <select and </span> just after </select> it still dosent work :/
 
Back
Top