View | Details | Raw Unified | Return to bug 7628
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt (-5 / +12 lines)
Lines 53-62 Link Here
53
	    var ok=0;
53
	    var ok=0;
54
		var _alertString=_("Form not submitted because of the following problem(s)");
54
		var _alertString=_("Form not submitted because of the following problem(s)");
55
		_alertString +="\n-------------------------------------------------------------------\n\n";
55
		_alertString +="\n-------------------------------------------------------------------\n\n";
56
		if (ff.categorycode.value.length==0) {
56
                ff.categorycode.value = ff.categorycode.value.trim();
57
		    ok=1;
57
                if (ff.categorycode.value.length==0) {
58
			_alertString += _("- categorycode missing") + "\n";
58
                   ok=1;
59
		}
59
                   _alertString += _("- categorycode missing") + "\n";
60
                }
61
                else{
62
                   var patt=/^[a-zA-Z0-9\-_]+$/g;	
63
                   if ( !patt.test(ff.categorycode.value) ) {
64
                      ok=1;
65
                      _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";			
66
                   }			
67
                }
60
		if (!(ff.category_type.value)){
68
		if (!(ff.category_type.value)){
61
		    ok=1;
69
		    ok=1;
62
		    _alertString += _("- category type missing") + "\n";
70
		    _alertString += _("- category type missing") + "\n";
63
- 

Return to bug 7628