//***************************************** // Begin Index.asp //***************************************** function loginpart() { document.loginform.submit() } //function CheckValues() //{ // if (document.log.id.value.length < 1) // { // alert("Fill in a Login Name") // return // } // if (document.log.password.value.length < 1) // { // alert("Fill in a Password") // return // } // document.log.submit() //} //***************************************** // Begin newpatron.asp //***************************************** var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } // End --> function CheckValues_newpatron() { if ((document.newpatron.fname.value < 1) || (document.newpatron.lname.value < 1)||(document.newpatron.add1.value < 1)||(document.newpatron.city.value < 1)) { alert("Please complete the required fields denoted by an * ") return } //if (document.newpatron.state.value < 1) //{ //alert("Please Select a State") //return //} var state = document.newpatron.state.options[document.newpatron.state.selectedIndex].value var SelfDesc = parseInt(document.newpatron.SelfDesc.options[document.newpatron.SelfDesc.selectedIndex].value,10) var EmpType = parseInt(document.newpatron.EmpType.options[document.newpatron.EmpType.selectedIndex].value,10) //alert(SelfDesc) //alert (document.newpatron.state.options[document.newpatron.state.selectedIndex].value) //alert (statex) //alert (EmpType) if (state == "xx") { alert("Please Select the state of your residence. ") return } if (document.newpatron.zip.value < 1) { alert("Please fill in a zip code") return } if ( SelfDesc == -98 ) { alert("Please Select an occupation. ") return } if (EmpType == -99) { alert("Please Select a Employer Type. ") return } if (document.newpatron.phone.value < 1) { alert("Please enter a daytime phone") return } if (document.newpatron.CIOAff.value < 1) { alert("Please enter a Facility or Employer") return } if (document.newpatron.email.value < 1) { alert("Please Enter an E-Mail Address") return } crucial = document.newpatron.email.value.indexOf ("@"); if(crucial == -1) { window.alert("The e-mail address you entered is not a valid E-mail address."); return } if (document.newpatron.email.value != document.newpatron.email2.value) { alert("Your emails do not match, please try again") return } /*Random Password Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } document.newpatron.rpass.value=password document.newpatron.submit() } //***************************************** // Begin setpass.asp //***************************************** function CheckValues_SetPass() { if ((document.newmember.pass1.value.length) < 1) { alert("Please Fill in a Password") return } if ((document.newmember.pass2.value.length) < 1) { alert("Please Confirm Your Password") return } if (((document.newmember.pass1.value.length) < 6)||((document.newmember.pass2.value.length) < 6)) { alert("Password length must be at least 6 characters") return } if ((document.newmember.pass1.value)!=(document.newmember.pass2.value)) { alert("passwords do not match") return } document.newmember.submit() } //***************************************** // Begin PatronEditParm.asp //***************************************** function CheckValues_PatronEditParm() { if (document.password.login.value < 1) { alert("Please provide a login name.") return } if (document.password.zipcode.value < 1) { alert("Please provide the proper zip code.") return } document.password.submit() } //***************************************** // Begin logn.asp //***************************************** function CheckValues_logn() { if (document.loginform.login.value.length < 1) { alert("Enter a Login Name") return } if (document.loginform.password.value.length < 1) { alert("Enter a Password") return } var loginsub = document.loginform.loginsub.value document.loginform.submit() } //***************************************** // Begin forgotpass.asp //***************************************** function CheckValues_forgotpass() { if (document.password.login.value < 1) { alert("Please fill in a login name") return } document.password.submit() } //***************************************** // Begin RequestAquitionGU.asp //***************************************** function CheckValues_RequestAquitionGU(iRoute) { if (document.ItemMaster.iDesc.value.length < 2 ) // trim it! { document.ItemMaster.iDesc.value = document.ItemMaster.iDesc.value.substring(0, 0); } if (document.ItemMaster.iDesc.value == "" ) { alert("Please provide a description of the requested material.") return } if (document.ItemMaster.iMaterialTitle.value == " ") { /* alert(document.ItemMaster.xxx.value) alert(document.ItemMaster.yyyy.value) */ alert("Enter the Material Title being recommended.") return } // //if (document.ItemMaster.iTopic.value == "") //{ // alert("Select a Valid Topic") // return //} // //213if ( document.ItemMaster.iMatType.value == 1 && document.ItemMaster.imatlength.value == "" ) //{ // alert("Enter the Length for the Video or Audio Media") // return //} //if ( document.ItemMaster.iMatType.value == 17 && document.ItemMaster.imatlength.value == "" ) //{ // alert("Enter the Length for the Video or Audio Media") // return //} //213if (document.ItemMaster.iMatType.value == "") //{ // alert("Select a Material Type") // return //} /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemMaster.submit() } //***************************************** // Begin RequestCkOutMeth2.asp //***************************************** function CheckValues_RequestCkOutMeth2() { document.Reqckout.submit() } // function2 from RequestCkOutMeth2 function checkDate(date) { alert (date) return false } //***************************************** // Begin NewPatronOfficeGenerated.asp //***************************************** //* Begin var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } //* End function CheckValues_NewPatronOfficeGenerated() { if ((document.newpatron.fname.value < 1) || (document.newpatron.lname.value < 1)||(document.newpatron.add1.value < 1)||(document.newpatron.city.value < 1)) { alert("Please complete the required fields denoted by an * ") return } //if (document.newpatron.state.value < 1) //{ //alert("Please Select a State") //return //} var state = document.newpatron.state.options[document.newpatron.state.selectedIndex].value var SelfDesc = parseInt(document.newpatron.SelfDesc.options[document.newpatron.SelfDesc.selectedIndex].value,10) var EmpType = parseInt(document.newpatron.EmpType.options[document.newpatron.EmpType.selectedIndex].value,10) //alert(SelfDesc) //alert (document.newpatron.state.options[document.newpatron.state.selectedIndex].value) //alert (statex) //alert (EmpType) if (state == "xx") { alert("Please Select the state of your residence. ") return } if (document.newpatron.zip.value < 1) { alert("Please fill in a zip code") return } if ( SelfDesc == -98 ) { alert("Please Select an occupation. ") return } if (EmpType == -99) { alert("Please Select a Employer Type. ") return } if (document.newpatron.phone.value < 1) { alert("Please enter a daytime phone") return } if (document.newpatron.CIOAff.value < 1) { alert("Please enter a Facility or Employer") return } if (document.newpatron.email.value < 1) { alert("Please Enter an E-Mail Address") return } crucial = document.newpatron.email.value.indexOf ("@"); if(crucial == -1) { window.alert("The e-mail address you entered is not a valid E-mail address."); return } if (document.newpatron.email.value != document.newpatron.email2.value) { alert("Your emails do not match, please try again") return } /*Random Password Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } document.newpatron.rpass.value=password document.newpatron.submit() } //***************************************** // Begin CkInByItemCopy.asp //***************************************** function CheckValues_CkInByItemCopy(iRoute) { if (document.ItemCk.Incopyno.value.length < 2 ) // trim it! { document.ItemCk.Incopyno.value = document.ItemCk.Incopyno.value.substring(0, 0); } if (document.ItemCk.Incopyno.value == "") { /* alert(document.ItemMaster.xxx.value) alert(document.ItemMaster.yyyy.value) */ alert("Enter a Valid Item being returned.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCk.submit() } //***************************************** // Begin CkOutByItemCopy_NoEmail.asp //***************************************** function CheckValues_CkOutByItemCopy_NoEmail(iRoute) { if (document.ItemCk.Incopyno.value.length < 2 ) // trim it! { document.ItemCk.Incopyno.value = document.ItemCk.Incopyno.value.substring(0, 0); } if (document.ItemCk.Pshipdate.value.length < 2 ) // trim it! { document.ItemCk.Pshipdate.value = document.ItemCk.Pshipdate.value.substring(0, 0); } if (document.ItemCk.Incopyno.value == "") { /* alert(document.ItemCk.xxx.value) alert(document.ItemCk.yyyy.value) */ alert("Enter a Valid Copy number.") return } if (document.ItemCk.Pshipdate.value == "") { alert("Enter an approximate shipping date.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCk.submit() } //***************************************** // Begin SendOverDueNotices.asp //***************************************** function CheckValues_SendOverDueNotices() { document.SndNotice.submit() } //***************************************** // Begin Renew.asp ....... Note: Includes other Generic Functions *********** //***************************************** function CheckValues_Renew() { if (document.ItemCk.copyno.value == "") { alert("Enter a Valid Copy Number.") return } //if (document.ItemCk.duedate.value == "") //{ // alert("Must Enter a Due Date") // return // } //} //var amonth = parseInt(document.ItemCk.f_month.options[document.ItemCk.f_month.selectedIndex].value,10)-1 //var aday = parseInt(document.ItemCk.f_day.options[document.ItemCk.f_day.selectedIndex].value,10) //var ayear = parseInt(document.ItemCk.f_year.options[document.ItemCk.f_year.selectedIndex].value,10) var amonth = parseInt(document.ItemCk.f_month.value,10) -1 var aday = parseInt(document.ItemCk.f_day.value,10) var ayear = parseInt(document.ItemCk.f_year.value,10) //alert (amonth) //alert (aday) //alert (ayear) // below amonth vars also assigned as t_month to save on editing until working //var amonth = parseInt(document.ItemCk.t_month.options[document.ItemCk.t_month.selectedIndex].value,10)-1 //var aday = parseInt(document.ItemCk.t_day.options[document.ItemCk.t_day.selectedIndex].value,10) //var ayear = parseInt(document.ItemCk.t_year.options[document.ItemCk.t_year.selectedIndex].value,10) var bmonth = parseInt(document.ItemCk.t_month.options[document.ItemCk.t_month.selectedIndex].value,10)-1 var bday = parseInt(document.ItemCk.t_day.options[document.ItemCk.t_day.selectedIndex].value,10) var byear = parseInt(document.ItemCk.t_year.options[document.ItemCk.t_year.selectedIndex].value,10) //var cmonth = parseInt(document.ItemCk.f_month.options[document.ItemCk.f_month.selectedIndex].value,10)-1 //var cday = parseInt(document.ItemCk.f_day.options[document.ItemCk.f_day.selectedIndex].value,10) + 4 //var cyear = parseInt(document.ItemCk.f_year.options[document.ItemCk.f_year.selectedIndex].value,10) var date1 = new Date(ayear,amonth,aday) var date2 = new Date(byear,bmonth,bday) //var ckdate = new Date(cyear,cmonth,cday) //alert (date1) //alert (date2) if (date2 < date1) { //alert("sysdate="+ date1) //alert(date2) alert("INVALID DATE range... Due date must be greater than today") return } //if ( validateDate(amonth) ) //{ alert("Good Month") //} //if (document.ItemCk.zzzzzz.value == "") //{ // alert("Select a Valid zzzzzzz") // return //} shipDate() document.ItemCk.submit() } function validateMonth(field, bypassUpdate) { var input = parseInt(field.value, 10) if (isEmpty(input)) { alert("Be sure to enter a month value.") select(field) return false } else { if (isNaN(input)) { alert("Entries must be numbers only.") select(field) return false } else { if (!inRange(input,1,12)) { alert("Enter a number between 1 (January) and 12 (December).") select(field) return false } } } if (!bypassUpdate) { calcDate() } return true } function validateDate1(field) { var input = parseInt(field.value, 10) if (isEmpty(input)) { alert("Be sure to enter a date value.") select(field) return false } else { if (isNaN(input)) { alert("Entries must be numbers only.") select(field) return false } else { var monthField = document.ItemCk.f_month if (!validateMonth(monthField, true)) return false var monthVal = parseInt(monthField.value, 10) var monthMax = new Array(31,31,29,31,30,31,30,31,31,30,31,30,31) var top = monthMax[monthVal] if (!inRange(input,1,top)) { alert("Enter a number between 1 and " + top + ".") select(field) return false } } } shipDate() calcDate() return true } function validateDate(field) { var input = parseInt(field.value, 10) if (isEmpty(input)) { alert("Be sure to enter a date value.") select(field) return false } else { if (isNaN(input)) { alert("Entries must be numbers only.") select(field) return false } else { var monthField = document.ItemCk.t_month if (!validateMonth(monthField, true)) return false var monthVal = parseInt(monthField.value, 10) var monthMax = new Array(31,31,29,31,30,31,30,31,31,30,31,30,31) var top = monthMax[monthVal] if (!inRange(input,1,top)) { alert("Enter a number between 1 and " + top + ".") select(field) return false } } } calcDate() return true } function validateYear(field) { var input = parseInt(field.value, 10) if (isEmpty(input)) { alert("Be sure to enter a month value.") select(field) return false } else { if (isNaN(input)) { alert("Entries must be numbers only.") select(field) return false } else { if (!inRange(input,2001,2010)) { alert("Enter a number between 2001 and 2010.") select(field) return false } } } calcDate() return true } function select(field) { field.focus() //field.select() ... not supported ????? } function shipDate() { var mm = parseInt(document.ItemCk.f_month.value, 10) var dd = parseInt(document.ItemCk.f_day.value, 10) var yy = parseInt(document.ItemCk.f_year.value, 10) //document.ItemCk.shipdate.value = mm + "/" + dd + "/" + yy } function calcDate() { var mm = parseInt(document.ItemCk.t_month.value, 10) var dd = parseInt(document.ItemCk.t_day.value, 10) var yy = parseInt(document.ItemCk.t_year.value, 10) document.ItemCk.duedate.value = mm + "/" + dd + "/" + yy //alert(document.ItemCk.duedate.value) } function checkForm(form) { if (validateMonth(form.t_month)) { if (validateDate(form.t_day)) { if (validateYear(form.t_year)) { return true } } } return false } //***************************************** // Begin SendOverDueNoticeSel.asp //***************************************** function CheckValues_SendOverDueNoticeSel() { if (document.ItemCk.copyno.value == "") { alert("Enter a Valid Copy Number.") return } document.ItemCk.submit() } //***************************************** // Begin ProcessDoc.asp //***************************************** function CheckValues_ProcessDoc() { /* if (document.ProcessDoc.duedate.value == "") { alert("Must Enter a Due Date") return } } */ document.ProcessDoc.submit() } //***************************************** // Begin PatronStanding.asp //***************************************** function CheckValues_PatronStanding(iRoute) { if (document.ItemCk.patronid.value.length < 2 ) // trim it! { document.ItemCk.patronid.value = document.ItemCk.patronid.value.substring(0, 0); } if (document.ItemCk.patronid.value == "") { alert("Enter a Valid Patron ID.") return } //alert(document.ItemCk.goodstanding.value) if (document.ItemCk.goodstanding.value == "") { alert("Select the Patron standing.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCk.submit() } //***************************************** // Begin PatronProfileList.asp ( 1st iteration < 15 )) //***************************************** function CheckValues_PatronProfileList() { if (document.PLIST.SrchLetter.value.substring(0, 1) == " " ) { //alert("Remove first space in the search criteria"); document.PLIST.SrchLetter.value = document.PLIST.SrchLetter.value.substring(1, 10); } if (document.PLIST.SrchLetter.value.length < 2 ) // trim it! { document.PLIST.SrchLetter.value = document.PLIST.SrchLetter.value.substring(0, 0); } if (document.PLIST.SrchLetter.value == "") { alert("Enter as many characters of last name as you desire to narrow the list, BUT enter a minimum of the first 2 characters of last name to produce results.") return } document.PLIST.submit() } //***************************************** // Begin PatronProfileList.asp ( 2nd iteration > 15)) //***************************************** function CheckValues_PatronProfileList2() { if (document.PLIST.SrchLetter2.value.substring(0, 1) == " " ) { //alert("Remove first space in the search criteria"); document.PLIST.SrchLetter2.value = document.PLIST.SrchLetter2.value.substring(1, 10); } if (document.PLIST.SrchLetter2.value.length < 2 ) // trim it! { document.PLIST.SrchLetter2.value = document.PLIST.SrchLetter2.value.substring(0, 0); } if (document.PLIST.SrchLetter2.value == "") { alert("Enter as many characters of last name as you desire to narrow the list, BUT enter a minimum of the first 2 characters of last name to produce results.") return } document.PLIST.submit() } //***************************************** // Begin KeywordAliasEdit.asp //***************************************** function CheckValues_KeywordAliasEdit(iRoute) { if (document.ItemCk.Itemno.value.length < 2 ) // trim it! { document.ItemCk.Itemno.value = document.ItemCk.Itemno.value.substring(0, 0); } if (document.ItemCk.Itemno.value == "") { alert("Enter a Valid Item.") return } document.ItemCk.submit() } //***************************************** // Begin MasterItemList.asp //***************************************** function CheckValues_MasterItemList() { document.CkOut.submit() } //***************************************** // Begin RequestAquition.asp //***************************************** function CheckValues_RequestAquition(iRoute) { if (document.ItemMaster.iMaterialTitle.value.length < 2 ) // trim it! { document.ItemMaster.iMaterialTitle.value = document.ItemMaster.iMaterialTitle.value.substring(0, 0); } if (document.ItemMaster.iMaterialTitle.value == "") { /* alert(document.ItemMaster.xxx.value) alert(document.ItemMaster.yyyy.value) */ alert("Enter a Valid MaterialTitle") return } // //if (document.ItemMaster.iTopic.value == "") //{ // alert("Select a Valid Topic") // return //} // //alert(document.ItemMaster.iMatType.value.length) //alert(document.ItemMaster.iMatType.value ) //if (document.ItemMaster.iMatType.value.length < 1 ) // trim it! //{ // document.ItemMaster.iMatType.value = document.ItemMaster.iMatType.value.substring(0, 0); //} if (document.ItemMaster.imatlength.value == 0 ) // trim it! { document.ItemMaster.imatlength.value = document.ItemMaster.imatlength.value.substring(0, 0); } //alert("Select a length="&document.ItemMaster.iMatType.value.length) if ( document.ItemMaster.iMatType.value == 1 && document.ItemMaster.imatlength.value == "" ) { alert("Enter the Length for the Video or Audio Media") return } if ( document.ItemMaster.iMatType.value == 17 && document.ItemMaster.imatlength.value == "" ) { alert("Enter the Length for the Video or Audio Media") return } if (document.ItemMaster.iMatType.value == "") { alert("Select a Material Type") return } //if (document.ItemMaster.iMatlev.value == "") //{ // alert("Select a Material Level") // return //} if (document.ItemMaster.iDistribYear.value.length < 2 ) // trim it! { document.ItemMaster.iDistribYear.value = document.ItemMaster.iDistribYear.value.substring(0, 0); } if (document.ItemMaster.iDistribYear.value == "") { alert("Enter a Valid Year of Publication for the material") return } if (document.ItemMaster.iDesc.value.length < 2 ) // trim it! { document.ItemMaster.iDesc.value = document.ItemMaster.iDesc.value.substring(0, 0); } if (document.ItemMaster.iDesc.value == "" ) { alert("Please provide a description of the requested material.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemMaster.submit() } //***************************************** // Begin ItemCopyNew.asp //***************************************** function CheckValues_ItemCopyNew(iRoute) { if (document.ItemCopy.iItemID.value == "") { alert("Item ID is required and must currently exist as an Item Master ! ") return } if (document.ItemCopy.iLibLoc.value.length < 1 ) // trim it! { document.ItemCopy.iLibLoc.value = document.ItemCopy.iLibLoc.value.substring(0, 0); } if (document.ItemCopy.iLibLoc.value == "") { alert("This new copy must be associated with a NLTN Location ! ") return } if (document.ItemCopy.iCollectionType.value.length < 1 ) // trim it! { document.ItemCopy.iCollectionType.value = document.ItemCopy.iCollectionType.value.substring(0, 0); } if (document.ItemCopy.iCollectionType.value == "") { alert("A Collection Type must be specified! ") return } if (document.ItemCopy.iCollAddedDate.value.length < 1 ) // trim it! { document.ItemCopy.iCollAddedDate.value = document.ItemCopy.iCollAddedDate.value.substring(0, 0); } if (document.ItemCopy.iCollAddedDate.value == "") { alert("Enter the Year that this copy was added to the collection") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCopy.submit() } //***************************************** // Begin ItemMasterEdit.asp //***************************************** function CheckValues_ItemMasterEdit() { if (document.ItemMaster.ititle.value.length < 2 ) // trim it! { document.ItemMaster.ititle.value = document.ItemMaster.ititle.value.substring(0, 0); } if (document.ItemMaster.ititle.value == "") { /* alert(document.ItemMaster.xxx.value) alert(document.ItemMaster.yyyy.value) */ alert("Enter a Valid MaterialTitle") return } // note : value of 24 means zz-remove topic from lu_table //if (document.ItemMaster.iTopic.value == "" || document.ItemMaster.iTopic.value == 24 ) //{ // alert("Enter a Valid PRIMARY Topic") // return //} if (document.ItemMaster.iDistribYear.value.length < 2 ) // trim it! { document.ItemMaster.iDistribYear.value = document.ItemMaster.iDistribYear.value.substring(0, 0); } if (document.ItemMaster.iDistribYear.value == "") { alert("Enter a Valid Year of Distribution for the material") return } if (document.ItemMaster.iDistribDate.value.length < 2 ) // trim it! { document.ItemMaster.iDistribDate.value = "1/1/1900"; } if (document.ItemMaster.iMatType.value.length < 1 ) // trim it! { document.ItemMaster.iMatType.value = document.ItemMaster.iMatType.value.substring(0, 0); } if (document.ItemMaster.iMatType.value == "") { alert("Select a Material Type") return } if ( document.ItemMaster.iMatType.value == 1 && document.ItemMaster.imatlength.value == "0" ) { alert("Enter the Length for the Video or Audio Media") return } if ( document.ItemMaster.iMatType.value == 17 && document.ItemMaster.imatlength.value == "0" ) { alert("Enter the Length for the Video or Audio Media") return } if (document.ItemMaster.iAvailWebAddr.value == " " ) // trim it! { document.ItemMaster.iAvailWebAddr.value = document.ItemMaster.iAvailWebAddr.value.substring(0, 0); } if ( document.ItemMaster.iMatType.value == 18 && document.ItemMaster.iAvailWebAddr.value == "" ) { alert("Enter a Web Address for a Material Type of Website. ") return } if (document.ItemMaster.iDesc.value == " " ) // trim it! { document.ItemMaster.iDesc.value = document.ItemMaster.iDesc.value.substring(0, 0); } if (document.ItemMaster.iDesc.value == "") { alert("Enter a Description for this title") return } Itemid = document.ItemMaster.Itemid.value ItemMaster.submit(Itemid) } //function checkDate(date) //{ //alert (date) //return false //} //***************************************** // Begin CopyList.asp //***************************************** function CheckValues_CopyList() { document.CkOut.submit() } //***************************************** // Begin ItemCopyEdit.asp //***************************************** function CheckValues_ItemCopyEdit() { if (document.ItemCopy.iloc.value == "") { /* alert(document.ItemCopy.xxx.value) alert(document.ItemCopy.yyyy.value) */ alert("Enter a Valid Library Location") return } if (document.ItemCopy.iColType.value == "") { alert("Enter a Collection Type") return } if (document.ItemCopy.iCollAddedDate.value == "") { alert("Enter a Valid Year added to collection") return } if (document.ItemCopy.iAvailable.value == "") { alert("Select if Available") return } Copyno = document.ItemCopy.Copyno.value ItemCopy.submit(Copyno) } function checkDate(date) { alert (date) return false } //***************************************** // Begin ItemRemoval.asp //***************************************** function CheckValues_ItemRemoval(iRoute) { if (document.ItemCk.Itemno.value.length < 2 ) // trim it! { document.ItemCk.Itemno.value = document.ItemCk.Itemno.value.substring(0, 0); } if (document.ItemCk.Itemno.value == "") { alert("Enter a Valid Item that is to be deleted from the database.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCk.submit() } //***************************************** // Begin CopyRemoval.asp //***************************************** function CheckValues_CopyRemoval(iRoute) { if (document.ItemCk.Copyno.value.length < 4 ) // trim it! { document.ItemCk.Copyno.value = document.ItemCk.Copyno.value.substring(0, 0); } if (document.ItemCk.Copyno.value == "") { alert("Enter a Valid Copy Number.") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemCk.submit() } //***************************************** // Begin ItemMasterNew.asp //***************************************** function CheckValues_ItemMasterNew(iRoute) { if (document.ItemMaster.iMaterialTitle.value.length < 4 ) // trim it! { document.ItemMaster.iMaterialTitle.value = document.ItemMaster.iMaterialTitle.value.substring(0, 0); } if (document.ItemMaster.iMaterialTitle.value == "") { /* alert(document.ItemMaster.xxx.value) alert(document.ItemMaster.yyyy.value) */ alert("Enter a Valid MaterialTitle") return } // Topics moved from Master Record per NLTN group // note : value of 24 means zz-remove topic from lu_table //if (document.ItemMaster.iTopic.value == "" || document.ItemMaster.iTopic.value == 24 ) //{ // alert("Enter a Valid PRIMARY Topic") // return //} if (document.ItemMaster.iMatType.value.length < 1 ) // trim it! { document.ItemMaster.iMatType.value = document.ItemMaster.iMatType.value.substring(0, 0); } if (document.ItemMaster.iMatType.value == "") { alert("Select a Material Type") return } // 05/30/2001 removed by NLTN group per Christine Ford //if (document.ItemMaster.iMatlev.value == "") //{ // alert("Select a Material Level") // return //} if (document.ItemMaster.imatlength.value == 0 ) // trim it! { document.ItemMaster.imatlength.value = document.ItemMaster.imatlength.value.substring(0, 0); } if ( document.ItemMaster.iMatType.value == 1 && document.ItemMaster.imatlength.value == "" ) { alert("Enter the Length for the Video or Audio Media") return } if ( document.ItemMaster.iMatType.value == 17 && document.ItemMaster.imatlength.value == "" ) { alert("Enter the Length for the Video or Audio Media") return } if (document.ItemMaster.iDistribYear.value.length < 2 ) // trim it! { document.ItemMaster.iDistribYear.value = document.ItemMaster.iDistribYear.value.substring(0, 0); } if (document.ItemMaster.iDistribYear.value == "") { alert("Enter a Valid Year of Distribution for the material") return } if (document.ItemMaster.iAvailWebAddr.value.length < 2 ) // trim it! { document.ItemMaster.iAvailWebAddr.value = document.ItemMaster.iAvailWebAddr.value.substring(0, 0); } if ( document.ItemMaster.iMatType.value == 18 && document.ItemMaster.iAvailWebAddr.value == "" ) { alert("Enter a Web Address for a Material Type of Website. ") return } /*Random Generator*/ /*var characters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"*/ var characters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" var passwordlength=5 var password = "" var n = 0 var randomnumber = 0 while( n < passwordlength ) { n ++ randomnumber = Math.floor(characters.length*Math.random()); password += characters.substring(randomnumber,randomnumber + 1) } /* alert("OK") */ document.ItemMaster.submit() } // ********************************************************************************** // ***************************************************************************** // **BEGIN GENERIC VALIDATION FUNCTIONS** // * // general purpose function to see if an input value has been entered at all function isEmpty(inputStr) { if (inputStr == "" || inputStr == null) { return true } return false } // function to determine if value is in acceptable range for this application function inRange(inputStr, lo, hi) { var num = parseInt(inputStr, 10) if (num < lo || num > hi) { return false } return true } // **END GENERIC VALIDATION FUNCTIONS** // ********************************************************************************** // **********************************************************************************