File Name : Tlessmodtrsa_tlesstrsammsubappr_user.js --------------------------------------------------- The following Code to be incorporated in the above JS file in the Proper place. Please Refer the Existing file version in Sourcesafe. //Handcoding begins var ctrl; var filepath= ""; var montage; var url = ""; var ctrlsplit; var folder = ""; //Handcoding ends //Handcode begins var phypath = ""; var virpath = ""; //Handcode ends //Handcode begins if (phypath=="") { var ctrl = window.document.getElementById("hdnHrhdn_attdocphysPath"); phypath = ctrl.value; } if (virpath=="") { montage=window.location.href.split("/"); url=montage[0]+"//" + montage[2] + "/" + montage[3] + "/" ; var ctrl = window.document.getElementById("hdnHrhdn_attdocvirPath"); virpath = ctrl.value; ctrlsplit = virpath.split("/"); folder = ctrlsplit[4] + "/"; virpath = url + folder; } refresh1(); return true; //Handcode ends } //Handcode begins function file_prefix() { // handcode for attachment filename prefix var now, prefix_date; now = new Date(); var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); var monthnumber = now.getMonth(); var monthday = now.getDate(); var year = now.getYear(); prefix_date = monthday + '' + monthnumber + '' + year + '_' + hour + '' + minute + '_'; return prefix_date; } function dofileuploadwrap() { var file_pref = file_prefix(); dofileupload(file_pref,"hdnhrhdn_attdocfilename",phypath,virpath,"","refresh1"); } function dofileupload(FileNamePrefix, HdnFileNameCtrl, PhyPath, VirPath, ImgCtrl, CallBackFuncName ) { var wdf = window.document.getElementById("iframefileupload").contentWindow.document.forms[0]; if (FileNamePrefix) wdf.txtfilenameprefix.value = FileNamePrefix; if (HdnFileNameCtrl) wdf.txthdnfilename.value = HdnFileNameCtrl; if (PhyPath) wdf.txtphypath.value = PhyPath; if (VirPath) wdf.txtvirpath.value = VirPath; if (ImgCtrl) wdf.ctrlimage.value = ImgCtrl; if (CallBackFuncName) wdf.txtfunctionname.value = CallBackFuncName; var ctrlFileUpload = wdf.uplTheFile; var btnUploadTheFile = wdf.btnUploadTheFile; var txtServername = wdf.txtServername; ctrlFileUpload.click(); if (ctrlFileUpload.value != "") { var arrfname = ctrlFileUpload.value.split("\\"); txtServername.value = FileNamePrefix+arrfname[arrfname.length-1]; wdf.txthdnfilename.value = FileNamePrefix+arrfname[arrfname.length-1]; btnUploadTheFile.click(); ctrl = window.document.getElementById(HdnFileNameCtrl); ctrl.value = FileNamePrefix+arrfname[arrfname.length-1]; if (ctrl) { var Path=window.location.href; var arrPath = Path.split("/"); filepath= ""; for(var cnt =0;cnt Attach Document
 
--(Add this below the above code)