사이트 내 전체검색
다른 Frame 에 Form 전달
로빈아빠
https://cmd.kr/javascript/620 URL이 복사되었습니다.

본문

다른 Frame 에 Form 전달

파일 업로드 하기위한 스크립트입니다.
이것을 응용하면 다른 Frame 에 Form을 전달 할 수 있습니다.
<script type="text/javascript">

	function onclick_attach(form) {
		if (form.uploadfile.value == "") {
			alert("업로드할 파일을 선택해 주세요\t");
			return false;
		} else {
			form.target='exe_iframe';
			form.action = 'mfile.php';
			form.mode.value = 'attach';
			form.submit();
		}
	}

	function onclick_delete(form) {
		var buffer = deleteList(form.filelist);
		if (trim(buffer) != '') {
			form.target='exe_iframe';
			form.action = 'mfile.php';
			form.mode.value = 'delete';
			form.deletefile.value = buffer;
			form.uploadfile.disabled = true;
			form.submit();
			form.uploadfile.disabled = false;
		}
	}

</script>
<? $image_file_path1 = date("md", time())."/"; ?>

<form method="post" enctype="multipart/form-data" name="fileupload" action="<?=$PHP_SELF?>">
<input type="hidden" name="image_file_path1" value="<?=$image_file_path1?>">
<input type="hidden" name="mode">
<input type="file" size="34" class="button" name="uploadfile" style="margin-left:18; margin-top:10; width:295px;">
<input type="button" class="button" value="파일 첨부하기" onclick="onclick_attach(fileupload);" style="width:95"><br>
</form>
<iframe name="exe_iframe" style="width:0; height:0;" frameborder="0" scrolling="no"></iframe>

댓글목록

등록된 댓글이 없습니다.

831 (3/17P)

Search

Copyright © Cmd 명령어 3.17.174.108