Commit Graph

18 Commits

Author SHA1 Message Date
Tim Hunt e8e2f4f62c MDL-31469 formslib: fix invalid for="" attributes on optional dates 2012-02-02 18:16:07 +00:00
Tim Hunt cb0318b633 MDL-30168 formslib: untangle automatic id generation.
Previously, we had overridden the _generateId method in almost all
subclasses; and then we mostly, but not always; ignored the value that
was generated there, and instead generated new (nicer) values in
MoodleQuickForm_Renderer::renderElement. Of course, that is not really a
logical place to (re)generate ids.

I have fixed the code so that the _generateId method now uses the 'nice
id' algorithm from renderElement. This should make the whole code flow
more logical.

This make all our overriding of _generateId unnecessary.

We do need a special _generateId for radio buttons, because you often
have different radio buttons with the same name but different values.

This change should only change the ids on radio, checkbox and
advcheckbox elements. Previously, those were essentially random, so I
don't think anyone could have been relying on the particular values.

This commit also has new unit tests, first to test the basic _generateId
algorithm, and then to create and render an example form (including some
tricky things like repeat_elements) and chech the acutal ids in the
generated HTML.
2011-12-23 11:19:48 +00:00
Marina Glancy 7b5702b681 MDL-19907 rewrote validation for required fields in forms, including support for editor field. Added parameter to use strict (no spaces) required fields validation 2011-07-29 13:51:26 +08:00
Petr Skoda 714dac9f7b MDL-24058 magic quotes are being delat with in our lib/setup.php, no need to use them again in our heavily hacked quickforms 2010-09-02 12:47:59 +00:00
Petr Skoda c1c89e3b21 MDL-16780, MDL-24058 removing PHP4 JSON implementation and related AJAX pear stuff that is not used any more - it is buggy, so we would have to either fix it (waste of time) or we have to remove it; no core code is using this and contrib can be easily updated to use standard json_encode() 2010-09-02 12:27:47 +00:00
Petr Skoda e56458a7c7 MDL-23486 fixed regression, sorrrrry 2010-07-24 19:19:37 +00:00
Petr Skoda a5e94d4bb3 MDL-23486 ugly ugly ugly hack - hardcoded required text checking in editor element; we should realy create new forms engine in 2.1 :-( 2010-07-23 18:31:31 +00:00
Jonathan Harker fcbf4b6fac lib/pear MDL-20876 fix deprecated split() calls to use explode, str_split or preg_split
Author: Jonathan Harker <jonathan@catalyst.net.nz>
2010-07-20 01:16:55 +00:00
Petr Skoda 6d504dc07f MDL-19698 deprecated assign new by ref in QuickForms 2010-07-19 08:38:28 +00:00
skodak 66491cf130 MDL-19415 fixing deprecated use of contructors 2009-07-02 14:58:41 +00:00
skodak 49ba2b61b9 MDL-19030 even uglier hack - do not try to add id to labels of static element - they do not have it; merged from MOODLE_19_STABLE 2009-04-30 10:09:13 +00:00
skodak 5c89242e50 MDL-19030 very ugly hack - do not try to add id to labels of element group - they do not have it; merged from MOODLE_19_STABLE 2009-04-30 10:06:11 +00:00
skodak 8c453e41f7 MDL-19030 fixed xhtml strictness when label attached to frozen element; merged from MOODLE_19_STABLE 2009-04-30 09:50:02 +00:00
nicolasconnault 1e074660da MDL-16780 Merging from MOODLE_19_STABLE 2008-10-03 07:13:16 +00:00
Martin Langhoff 08103c9364 cvsimport fixups 2007-07-07 14:18:30 +12:00
Martin Langhoff f3f7610c90 cvsimport fixups -- cvshead had strayed from upstream 2007-01-04 13:15:04 +13:00
jamiesensei f0e2d0ac80 upgraded tableless pear quickform packages 2006-09-27 16:31:11 +00:00
jamiesensei da6f876395 This is a first cut of a new formslib.php a library of classes for creating and securely processing forms in Moodle, based on PEAR QuickForms. Only uses XHTML and CSS and no table tags.
This is NOT YET PART OF THE MOODLE API it is here for experimental purposes.
2006-09-24 17:04:51 +00:00