Skip to content
Permalink
Browse files

MDL-30909 Forms: Custom ID can be set on a form

  • Loading branch information...
FMCorz committed Sep 13, 2012
1 parent c8ac480 commit 28c7749fc7de5537871ac01caa0fab90b6e96378
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/formslib.php
@@ -1301,13 +1301,15 @@ function MoodleQuickForm($formName, $method, $action, $target='', $attributes=nu
} else {
$this->_pageparams = '';
}
//no 'name' atttribute for form in xhtml strict :
$attributes = array('action'=>$action, 'method'=>$method,
'accept-charset'=>'utf-8', 'id'=>'mform'.$formcounter) + $target;
// No 'name' atttribute for form in xhtml strict :
$attributes = array('action' => $action, 'method' => $method, 'accept-charset' => 'utf-8') + $target;
if (is_null($this->getAttribute('id'))) {
$attributes['id'] = 'mform' . $formcounter;
}
$formcounter++;
$this->updateAttributes($attributes);
//this is custom stuff for Moodle :
// This is custom stuff for Moodle :
$oldclass= $this->getAttribute('class');
if (!empty($oldclass)){
$this->updateAttributes(array('class'=>$oldclass.' mform'));

0 comments on commit 28c7749

Please sign in to comment.
You can’t perform that action at this time.