-----------------------------------
pages with form class (ex: edituser.php)
--------------------------------
</td></tr><input type='hidden' name='uid' id='uid' value='1' /><tr><td>
or
</td></tr><tr><input type='hidden' name='uid' id='uid' value='1' /><td>
or
<table><input type='hidden' name='uid' id='uid' value='1' /><tr><td>
or
</td></tr><input type='hidden' name='uid' id='uid' value='1' /></table>
This kind of coding above always give us some error message like this....
document type does not allow element "input" here
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading
Refer to this page
http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd
So..
If we use form classes such as XoopsTableForm(tableform.php), XoopsThemeForm(themeform.php) with XoopsFormHidden(formhidden.php),
we can never get the message," "This Page Is Valid XHTML 1.0 Transitional!" from W3 validator.
ex)
tableform.php
function render()
{
$ret = $this->getTitle()."n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">n<table border='0' width='100%'>n";
foreach ( $this->getElements() as $ele ) {
if ( !$ele->isHidden() ) {
$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
if ($ele->getDescription() != '') {
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
}
$ret .= "</td><td>".$ele->render()."</td></tr>";
} else {
$ret .= $ele->render()."n";
}
}
$ret .= "</table>n</form>n";
return $ret;
}
if element is hidden,
it will be rendered like this!
$ret .= $ele->render()."\n";
formhidden.php
function render(){
return "<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."' />";
}
Umm...
I think there are some solutions for this problem..
At my first thought,
maybe...
the most simplest solution is to just remove if ( !$ele->isHidden() ) process like this below.
tableform.php
//if ( !$ele->isHidden() ) {
$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
if ($ele->getDescription() != '') {
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
}
$ret .= "</td><td>".$ele->render()."</td></tr>";
//} else {
// $ret .= $ele->render()."n";
//}
themeform.php
if (!is_object($ele)) {
$ret .= $ele;
//} elseif (!$ele->isHidden()) {
} else {
//if ($count % 2 == 0) {
$class = 'even';
//} else {
// $class = 'odd';
//}
$ret .= "<tr valign='top' align='left'><td class='head'>".$ele->getCaption();
if ($ele->getDescription() != '') {
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
}
$ret .= "</td><td class='$class'>".$ele->render()."</td></tr>";
//$count++;
//} else {
// $ret .= $ele->render();
}
------------------------------
After this modification,
(......although we use form classes.....)
we can get this message, "This Page(ex: edituser.php) Is Valid XHTML 1.0 Transitional!" from W3 validator.
--------To be continued--------------