Mercurial > p > roundup > code
diff templates/classic/html/help_controls.js @ 3704:18def94e5150
macro th_label:
- usage of th_label in user.item.html (for a start)
- macro search_select_translated (for status and priority)
- Javascript support for adding uses (just past the email address and
leave the input field)
| author | Tobias Herp <tobias-herp@users.sourceforge.net> |
|---|---|
| date | Sun, 17 Sep 2006 23:27:21 +0000 |
| parents | 3f3ca882deb2 |
| children | ba2eeadeed69 |
line wrap: on
line diff
--- a/templates/classic/html/help_controls.js Sun Sep 17 23:22:29 2006 +0000 +++ b/templates/classic/html/help_controls.js Sun Sep 17 23:27:21 2006 +0000 @@ -44,6 +44,16 @@ return list; } +/** + * update the field in the opening window; + * the text_field variable must be set in the calling page + */ +function updateOpener() { + // write back to opener window + if (document.frm_help.check==undefined) { return; } + form[field].value = text_field.value; +} + function updateList() { // write back to opener window if (document.frm_help.check==undefined) { return; } @@ -64,6 +74,40 @@ } } +function reviseList_framed(form, textfield) { + // update the checkboxes based on the preview field + // alert('reviseList_framed') + // alert(form) + if (form.check==undefined) + return; + // alert(textfield) + var to_check; + var list = textfield.value.split(","); + if (form.check.length==undefined) { + check = form.check; + to_check = false; + for (val in list) { + if (check.value==trim(list[val])) { + to_check = true; + break; + } + } + check.checked = to_check; + } else { + for (box=0; box < form.check.length; box++) { + check = form.check[box]; + to_check = false; + for (val in list) { + if (check.value==trim(list[val])) { + to_check = true; + break; + } + } + check.checked = to_check; + } + } +} + function reviseList(vals) { // update the checkboxes based on the preview field if (document.frm_help.check==undefined) { return; } @@ -121,3 +165,41 @@ } } +function checkRequiredFields(fields) +{ + var bonk=''; + var res=''; + var argv = checkRequiredFields.arguments; + var argc = argv.length; + var input = ''; + var val=''; + + for (var i=0; i < argc; i++) { + fi = argv[i]; + input = document.getElementById(fi); + if (input) { + val = input.value + if (val == '' || val == '-1' || val == -1) { + if (res == '') { + res = fi; + bonk = input; + } else { + res += ', '+fi; + } + } + } else { + alert('Field with id='+fi+' not found!') + } + } + if (res == '') { + return submit_once(); + } else { + alert('Missing value here ('+res+')!'); + if (window.event && window.event.returnvalue) { + event.returnValue = 0; // work-around for IE + } + bonk.focus(); + return false; + } +} +
