show alert in javascript and not continue
-
hi i use this code:
<script type='text/javascript'>
function ValidateFileSize(strFUS) {
var filename = document.getElementById('<%=fuSignature.ClientID%>');var myFSO = new ActiveXObject("Scripting.FileSystemObject"); var filepath = filename.value; var thefile = myFSO.getFile(filepath); var size = thefile.size; if (size / 1024 < 110) return true; alert('the size of file is big'); return false; }
</script>
this code is work and show me the alert but when i click on ok button in allert box the file uploadbut i want it not be upload. what should i do? plz
-
hi i use this code:
<script type='text/javascript'>
function ValidateFileSize(strFUS) {
var filename = document.getElementById('<%=fuSignature.ClientID%>');var myFSO = new ActiveXObject("Scripting.FileSystemObject"); var filepath = filename.value; var thefile = myFSO.getFile(filepath); var size = thefile.size; if (size / 1024 < 110) return true; alert('the size of file is big'); return false; }
</script>
this code is work and show me the alert but when i click on ok button in allert box the file uploadbut i want it not be upload. what should i do? plz
-
hi i use this code:
<script type='text/javascript'>
function ValidateFileSize(strFUS) {
var filename = document.getElementById('<%=fuSignature.ClientID%>');var myFSO = new ActiveXObject("Scripting.FileSystemObject"); var filepath = filename.value; var thefile = myFSO.getFile(filepath); var size = thefile.size; if (size / 1024 < 110) return true; alert('the size of file is big'); return false; }
</script>
this code is work and show me the alert but when i click on ok button in allert box the file uploadbut i want it not be upload. what should i do? plz
-
hi ptvc, you code is ok, you only need to return the function value where you call the function. for example you call it on a button click you would write