Permalink
Browse files

MDL-30526 Choice: add form validation rule for numeric field

  • Loading branch information...
1 parent 71f5d75 commit 186577a9d570ef1c1fbf6742fb44655c657af977 Ruslan Kabalin committed with Sam Hemelryk Nov 30, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/choice/mod_form.php
View
@@ -49,10 +49,11 @@ function definition() {
$repeateloptions = array();
$repeateloptions['limit']['default'] = 0;
$repeateloptions['limit']['disabledif'] = array('limitanswers', 'eq', 0);
+ $repeateloptions['limit']['rule'] = 'numeric';
$mform->setType('limit', PARAM_INT);
$repeateloptions['option']['helpbutton'] = array('choiceoptions', 'choice');
- $mform->setType('option', PARAM_CLEAN);
+ $mform->setType('option', PARAM_CLEANHTML);
$mform->setType('optionid', PARAM_INT);

0 comments on commit 186577a

Please sign in to comment.