function getParams(formName) { var frmMain = document.getElementById(formName)?document.getElementById(formName):document.getElementsByName(formName)[0]; var keys=""; var values=""; var params=""; var textarea=new Array(); var textareaValue=new Array(); var hidden=new Array(); var hiddenValue=new Array(); var select=new Array(); var selectValue=new Array(); var text=new Array(); var textValue=new Array(); var checkboxValue=new Array(); var checkboxAll=new Array(); var checkbox=new Array(); var radio=new Array(); var radioAll=new Array(); var radioValue=new Array(); /** * checkbox */ for(var c0=0;c0<frmMain.length;c0++){ if(frmMain.elements[c0].type=='checkbox'){ if(frmMain.elements[c0].name!="" && frmMain.elements[c0].name!=undefined){ checkboxAll.push(frmMain.elements[c0].name); } } } checkboxAll.sort(); for(var c1=0;c1<checkboxAll.length;c1++){ if(checkboxAll[c1]==checkboxAll[c1+1]){ continue; } checkbox[checkbox.length]=checkboxAll[c1]; } for(var c2=0;c2<checkbox.length;c2++){ var checkboxArr=document.getElementsByName(checkbox[c2]); checkboxValue[c2]=""; for(var c3=0;c3<checkboxArr.length;c3++){ if(checkboxArr[c3].checked){ checkboxValue[c2]+=checkboxArr[c3].value+"<#ARR>"; } } } /** * radio */ for(var r0=0;r0<frmMain.length;r0++){ if(frmMain.elements[r0].type=='radio'){ if(frmMain.elements[r0].name!="" && frmMain.elements[r0].name!=undefined){ radioAll.push(frmMain.elements[r0].name); } } } radioAll.sort(); for(var r1=0;r1<radioAll.length;r1++){ if(radioAll[r1]==radioAll[r1+1]){ continue; } radio[radio.length]=radioAll[r1]; } for(var r2=0;r2<radio.length;r2++){ var radioArr=document.getElementsByName(radio[r2]); radioValue[r2]=""; for(var r3=0;r3<radioArr.length;r3++){ if(radioArr[r3].checked){ radioValue[r2]=radioArr[r3].value; } } } /** * text */ for(var t0=0;t0<frmMain.length;t0++){ if(frmMain.elements[t0].type=='text'){ if(frmMain.elements[t0].name!="" && frmMain.elements[t0].name!=undefined){ text.push(frmMain.elements[t0].name); textValue.push(frmMain.elements[t0].value); } } } /** * textarea */ for(var t1=0;t1<frmMain.length;t1++){ if(frmMain.elements[t1].type=='textarea'){ if(frmMain.elements[t1].name!="" && frmMain.elements[t1].name!=undefined){ textarea.push(frmMain.elements[t1].name); textareaValue.push(frmMain.elements[t1].value); } } } /** * select_one */ for(var s0=0;s0<frmMain.length;s0++){ if(frmMain.elements[s0].type=='select-one'){ if(frmMain.elements[s0].name!="" && frmMain.elements[s0].name!=undefined){ select.push(frmMain.elements[s0].name); selectValue.push(frmMain.elements[s0].value); } } } /** * hidden */ for(var h0=0;h0<frmMain.length;h0++){ if(frmMain.elements[h0].type=='hidden'){ if(frmMain.elements[h0].name!="" && frmMain.elements[h0].name!=undefined){ if(frmMain.elements[h0].name!='parameters'){ hidden.push(frmMain.elements[h0].name); hiddenValue.push(frmMain.elements[h0].value); } } } } for(var v1=0;v1<textValue.length;v1++){ values+=textValue[v1]+"<#>"; } for(var v6=0;v6<textareaValue.length;v6++){ values+=textareaValue[v6]+"<#>"; } for(var v2=0;v2<radioValue.length;v2++){ values+=radioValue[v2]+"<#>"; } for(var v3=0;v3<checkboxValue.length;v3++){ values+=checkboxValue[v3]+"<#>"; } for(var v4=0;v4<selectValue.length;v4++){ values+=selectValue[v4]+"<#>"; } for(var v5=0;v5<hiddenValue.length;v5++){ if(v5==hiddenValue.length-1){ if(hiddenValue[v5]==""){ hiddenValue[v5]="<#NULL>"; } } values+=hiddenValue[v5]+"<#>"; } values=values.substring(0,values.length-3); values=values.split(" ").join("<#SPA>"); for(var k1=0;k1<text.length;k1++){ keys+=text[k1]+","; } for(var k6=0;k6<textarea.length;k6++){ keys+=textarea[k6]+","; } for(var k2=0;k2<radio.length;k2++){ keys+=radio[k2]+","; } for(var k3=0;k3<checkbox.length;k3++){ keys+=checkbox[k3]+","; } for(var k4=0;k4<select.length;k4++){ keys+=select[k4]+","; } for(var k5=0;k5<hidden.length;k5++){ keys+=hidden[k5]+","; } keys=keys.substring(0,keys.length-1); params=keys+"|"+values; frmMain.parameters.value=params; }