토타토타

input 입력하면 스크립트 소스에 등록되게 하고싶습니다.

<input type="text" name="formtext1"><a href="javascript:downloadHtmlSource();">확인</a>

<iframe id="ifrmAction" name="ifrmAction" width="50" height="50" scrolling="no" ></iframe>

<script>
function downloadHtmlSource()
{
 try
 {
  var ifrmAction = window.document.getElementById("ifrmAction");
  var sUrl = "http://test.php?ID_CUST=<?=$a?>";
  ifrmAction.src = sUrl;
  setTimeout("getSource()",1000);
 }
 catch (ex)
 {
 }
}

function getSource()
{
 try
 {
  var elBody = ifrmAction.document.body;
  alert(elBody.innerHTML);
 }
 catch (ex)
 {
 }
}
</script>

위의 소스중에요 input 박스에 숫자를 입력하면 중간에 있는 <?=$a?> <-- 이부분에 들어가서
실행되게 하려면 어떻게 해야 할까요?

댓글 1개

<input type="text"

onChange="sUrl='http://test.php?ID_CUST='+this.value;"

name="formtext1"><a href="javascript:downloadHtmlSource();">확인</a>

<iframe id="ifrmAction" name="ifrmAction" width="50" height="50" scrolling="no" ></iframe>

<script>
var sUrl='';
function downloadHtmlSource()
{
try
{
var ifrmAction = window.document.getElementById("ifrmAction");

ifrmAction.src = sUrl;
setTimeout("getSource()",1000);
}
catch (ex)
{
}
}

function getSource()
{
try
{
var elBody = ifrmAction.document.body;
alert(elBody.innerHTML);
}
catch (ex)
{
}
}
</script>
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
09-08-26 조회 1,091
09-08-26 조회 2,763
09-08-26 조회 897
09-08-26 조회 1,015
09-08-26 조회 1,564
09-08-26 조회 1,686
09-08-26 조회 1,651
09-08-26 조회 1,639
09-08-26 조회 2,131
09-08-25 조회 940
09-08-25 조회 1,271
09-08-25 조회 1,174
09-08-25 조회 1,091
09-08-25 조회 1,123
09-08-25 조회 1,304
09-08-25 조회 1,105
09-08-25 조회 952
09-08-25 조회 2,844
09-08-25 조회 1,401
09-08-25 조회 1,570