Revision: 48316 Author: yaron Date: 2009-03-11 16:38:02 +0000 (Wed, 11 Mar 2009)
Log Message: ----------- New validate_mandatory_radiobutton() Javascript function Modified Paths: -------------- trunk/extensions/SemanticForms/includes/SF_FormUtils.inc Modified: trunk/extensions/SemanticForms/includes/SF_FormUtils.inc =================================================================== --- trunk/extensions/SemanticForms/includes/SF_FormUtils.inc 2009-03-11 15:49:28 UTC (rev 48315) +++ trunk/extensions/SemanticForms/includes/SF_FormUtils.inc 2009-03-11 16:38:02 UTC (rev 48316) @@ -91,6 +91,19 @@ } } +// special handling for radiobuttons, because what's being checked +// is the first radiobutton, which has value of "None" +function validate_mandatory_radiobutton(none_button_id, info_id) { + none_button = document.getElementById(none_button_id); + if (none_button.value.replace(/\s+/, '') == '') { + return true; + } else { + infobox = document.getElementById(info_id); + infobox.innerHTML = "$blank_error_str"; + return false; + } +} + function validate_mandatory_checkboxes(field_id, info_id) { elems = document.getElementsByTagName("*"); var all_fields_unchecked = true; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs