Widget test

July 6, 2017


July 6, 2017

function search(form) {
alert(“Enter a term for search”);
var length_chksrch=0;
var field=””;
var chk_multi_search=0;
var psycnetpath=form.APA_path.value;
var term=form.APA_searchtext.value;
var length_chksrch=form.APA_dvSelectType.length;
if(term==””) {
alert(“Enter a term for search”); return false;
}
if(length_chksrch==0) {
field=form.APA_search_option.value;
}
else {
for(i=0;i<length_chksrch;i++) {
if(form.APA_dvSelectType.options[i].selected==true && chk_multi_search==0) {
field+=form.APA_dvSelectType.options[i].value;
chk_multi_search=1;
}
else if(form.APA_dvSelectType.options[i].selected==true && chk_multi_search==1) {
field+=","+form.APA_dvSelectType.options[i].value;
}
}
}
if(field=="") {
alert("Select at least 1 search field");
return false;
}
var db=form.APA_database.value;
var db = db.replace(",all","");
var type="advanced";
var APA_url=psycnetpath+"?fa=search.searchResults&type="+type+"&db="+db+"&term="+term+"&fields="+field;
window.open(APA_url);
return false;
}


Widget Test

July 6, 2017