Permalink
Browse files

wrapping group element in a fieldset tag

  • Loading branch information...
1 parent ec929cd commit 15fdf6199ed3998698aceecebd3071ab4c906fe3 jamiesensei committed Sep 28, 2006
Showing with 9 additions and 7 deletions.
  1. +3 −4 lib/formslib.php
  2. +6 −3 theme/standard/styles_form.css
View
@@ -258,9 +258,8 @@ class moodleform_renderer extends HTML_QuickForm_Renderer_Tableless{
function moodleform_renderer(){
// switch next two lines for ol li containers for form items.
// $this->_elementTemplates=array('default'=>"\n\t\t<li class=\"fitem\"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class=\"qfelement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></li>");
- $this->_elementTemplates=array('default'=>"\n\t\t<div class=\"fitem\"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class=\"felement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div>"); /*,
- will cause problems with client side validation so will leave for now
- 'fieldset'=>"\n\t\t<div class=\"qfrow\"><label class=\"qflabel\">{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><fieldset class=\"qfelement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</fieldset></div>");*/
+ $this->_elementTemplates=array('default'=>"\n\t\t<div class=\"fitem\"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class=\"felement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div>",
+ 'fieldset'=>"\n\t\t<div class=\"fitem\"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><fieldset class=\"felement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</fieldset></div>");
parent::HTML_QuickForm_Renderer_Tableless();
}
@@ -311,7 +310,7 @@ function renderElement(&$element, $required, $error){
}
$this->_templates[$element->getName()]=$html;
- $element->updateAttributes(array('id'=>'id_'.$element->getName()));
+ $element->updateAttributes(array('id'=>'id_'.$element->getAttribute('id')));
parent::renderElement($element, $required, $error);
}
@@ -15,9 +15,12 @@ form.mform fieldset {
margin: 0;
width:100%;
}
-form.mform fieldset.hidden {
+form.mform fieldset.hidden, form.mform fieldset.felement {
border: 0;
}
+form.mform fieldset.felement {
+ width: auto;
+}
form.mform fieldset legend {
font-weight: bold;
}
@@ -50,13 +53,13 @@ form.mform label {
margin: 0 0 0 0;
text-align: right;
}
-div.fitem div.fgroup label {
+div.fitem fieldset.fgroup label {
display:inline;
float: none;
width: auto;
}
-form.mform div.felement {
+form.mform div.felement, form.mform fieldset.felement{
/* display: inline; */
display: block;
float: left;

0 comments on commit 15fdf61

Please sign in to comment.