Ragazzi vi scrivo la funzione che richiamo all'atto del submit; ho tentato di inserire anche la vostra funzione, ma così come ho scritto mi esce la finestra di alert ma successivamente non termina lo script ma prosegue.
codice:<SCRIPT LANGUAGE="JavaScript"> function ShowProgress() { //--------------- var str_controlla; str_controlla = Controlla(); if (str_controlla) { return false; } //--------------- strAppVersion = navigator.appVersion; if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "") { if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { winstyle = "dialogWidth=375px; dialogHeight:130px; center:yes"; window.showModelessDialog('<% = barref %>&b=IE',null,winstyle); } else { window.open('<% = barref %>&b=NN','','width=370,height=115', true); } } return true; } function Controlla(){ var erNome = 'pratiche.xls'; var erFile = document.MyForm.FILE1.value; if(erFile.substr(erFile.lastIndexOf('\\')+1).toLowerCase()!=erNome){ alert('Il file deve essere '+erNome); return false; }return true; } </SCRIPT> ...... <FORM NAME="MyForm" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="progress_upload_2.asp?<% = PID %>" OnSubmit="return ShowProgress();">
Come posso fare?

Rispondi quotando