파일 선택 안하고 alert창 뿌리기
이거 그냥 쉬울지 알고 했는데 ...
우선
1. 파일 업로드할 jsp단에 hidden 속성으로 값 한개 추가한다.
2. 기본값 = 0
1. 파일 추가 시 hidden 의 value 값을 변경
2. 해당 파일 삭제 시 다시 0으로 변경
==========파일업로드 jsp단====================
<input type="hidden" name="check" value="0"> //추가
<script>
생략~~~
//파일없을시 경고창
if(document.upFrm.check.value == "0"){
alert("파일을 선택 하셔야 합니다.");
return false;
}
swfu.startUpload();//업로드 시작
</script>
==================handlers.js=====================
부분에서
function fileQueued(file) { //이 부분이 파일을 선택하였을때 호출되는 부분이다.
try {
document.upFrm.check.value=file.name; //check값에 파일명을 기입
var progress = new FileProgress(file, this.customSettings.progressTarget);
progress.setStatus("アップロードの準備");
progress.toggleCancel(true, this);
} catch (ex) {
this.debug(ex);
}
}
=======================fileprogress.js=======================
여기까지 좋았는데 파일 선택 후 삭제시 value값이 바뀌지 않아서
그부분에 value값을 0으로
// Show/Hide the cancel button
FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
if (swfUploadInstance) {
var fileID = this.fileProgressID;
this.fileProgressElement.childNodes[0].onclick = function () {
swfUploadInstance.cancelUpload(fileID);
document.upFrm.check.value="0"; //삭제버튼 클릭시 value 값을 0으로 변경
return false;
};
}
};
======================================================
ps.혹시 더 좋은 방법있으시면 공유해주세요~<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
이거 그냥 쉬울지 알고 했는데 ...
우선
1. 파일 업로드할 jsp단에 hidden 속성으로 값 한개 추가한다.
2. 기본값 = 0
1. 파일 추가 시 hidden 의 value 값을 변경
2. 해당 파일 삭제 시 다시 0으로 변경
==========파일업로드 jsp단====================
<input type="hidden" name="check" value="0"> //추가
<script>
생략~~~
//파일없을시 경고창
if(document.upFrm.check.value == "0"){
alert("파일을 선택 하셔야 합니다.");
return false;
}
swfu.startUpload();//업로드 시작
</script>
==================handlers.js=====================
부분에서
function fileQueued(file) { //이 부분이 파일을 선택하였을때 호출되는 부분이다.
try {
document.upFrm.check.value=file.name; //check값에 파일명을 기입
var progress = new FileProgress(file, this.customSettings.progressTarget);
progress.setStatus("アップロードの準備");
progress.toggleCancel(true, this);
} catch (ex) {
this.debug(ex);
}
}
=======================fileprogress.js=======================
여기까지 좋았는데 파일 선택 후 삭제시 value값이 바뀌지 않아서
그부분에 value값을 0으로
// Show/Hide the cancel button
FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
if (swfUploadInstance) {
var fileID = this.fileProgressID;
this.fileProgressElement.childNodes[0].onclick = function () {
swfUploadInstance.cancelUpload(fileID);
document.upFrm.check.value="0"; //삭제버튼 클릭시 value 값을 0으로 변경
return false;
};
}
};
======================================================
ps.혹시 더 좋은 방법있으시면 공유해주세요~<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4110 | |
| 29 |
아우겐나이스
|
21년 전 | 4485 | |
| 28 |
아우겐나이스
|
21년 전 | 3509 | |
| 27 | 21년 전 | 5889 | ||
| 26 | 21년 전 | 3168 | ||
| 25 | 21년 전 | 6146 | ||
| 24 | 18년 전 | 3704 | ||
| 23 | 21년 전 | 3698 | ||
| 22 | 21년 전 | 4286 | ||
| 21 | 21년 전 | 3877 | ||
| 20 | 21년 전 | 4284 | ||
| 19 | 21년 전 | 6731 | ||
| 18 | 21년 전 | 4777 | ||
| 17 | 21년 전 | 7024 | ||
| 16 | 21년 전 | 4216 | ||
| 15 | 21년 전 | 2681 | ||
| 14 | 21년 전 | 5015 | ||
| 13 | 21년 전 | 3440 | ||
| 12 |
Recluse
|
21년 전 | 3919 | |
| 11 |
아우겐나이스
|
21년 전 | 3600 | |
| 10 |
Recluse
|
21년 전 | 3442 | |
| 9 | 21년 전 | 4060 | ||
| 8 | 21년 전 | 5231 | ||
| 7 | 21년 전 | 4805 | ||
| 6 | 21년 전 | 5757 | ||
| 5 | 21년 전 | 4164 | ||
| 4 | 21년 전 | 4897 | ||
| 3 | 21년 전 | 4786 | ||
| 2 | 21년 전 | 3291 | ||
| 1 | 22년 전 | 4383 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기