GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — openspecimen/javascripts/de/AdvancedSearchScripts.js at trunk · khots/openspecimen Expand file tree/ Copy pathAdvancedSearchScripts.jsMore file actions 94 lines (86 loc) · 2.51 KB / Copy pathAdvancedSearchScripts.jsFile metadata and controls94 lines (86 loc) · 2.51 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 /*This is the wrapper function over show_calendar() that allows to select the date only if the operator is Not 'ANY' opratorListId : Id of the date-operators list box formNameAndDateFieldId : A string that contains the form name & date field's id isSecondDateField : A boolean variable that tells whether the date field is first or second */ function onDate(operatorListId,formNameAndDateFieldId,isSecondDateField) { var dateCombo = document.getElementById(operatorListId); if(dateCombo.options[dateCombo.selectedIndex].value != "Any") { if(!isSecondDateField) { show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY') } else { if(dateCombo.options[dateCombo.selectedIndex].value == "Between" || dateCombo.options[dateCombo.selectedIndex].value == "Not Between") { show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY'); } } } } /*Generic function to enable/disable value fields as per the operator selected opratorListId : Id of the operators list box valueFieldId : Id of the value field (Textbox/List) which is to be enabled/disabled */ function onOperatorChange(operatorListId,valueFieldId) { var opCombo = document.getElementById(operatorListId); var valField = document.getElementById(valueFieldId); if(opCombo.options[opCombo.selectedIndex].value == "Any") { if(valField.type == "text") { valField.value = ""; valField.disabled = true; } else { valField.options[0].selected = true; valField.disabled = true; } } else { valField.disabled = false; } } /*This function enables the second date field only if the operator is 'Between' or 'Not Between' & disables both the date fields if operator is 'ANY' element : An object of type list dateFiled1 : An id of date field one dateFiled2 : An id of date field two */ function onDateOperatorChange(element,dateFiled1,dateFiled2) { var dateTxt1 = document.getElementById(dateFiled1); var dateTxt2 = document.getElementById(dateFiled2); if(element.value == "Between" || element.value == "Not Between") { dateTxt1.disabled = false; dateTxt2.disabled = false; } else if(element.value == "Any") { dateTxt1.value = ""; dateTxt1.disabled = true; dateTxt2.value = ""; dateTxt2.disabled = true; } else { dateTxt1.disabled = false; dateTxt2.value = ""; dateTxt2.disabled = true; } } /*This function forwards the request to the given action action : An action to which request is to be forwarded */ function onAddRule(action) { document.forms[0].action = action; document.forms[0].submit(); } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |