input 입력하면 스크립트 소스에 등록되게 하고싶습니다. 정보
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?> <-- 이부분에 들어가서
실행되게 하려면 어떻게 해야 할까요?
댓글 전체
<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>
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>