폼전송할때 변수넘기는방법
본문
입력된번호를 다른페이지로 값을넘겨주는데 잘안됨니다.ㅜ.ㅜ
빨간부분에 <?=$member[mb_hp]?> 이렇게넣어봐도안되구해서 문의좀드립니다
<input class=m_text type=text name='mb_hp' size=21 maxlength=20 <?=$config[cf_req_hp]?'required':'';?> itemname='핸드폰번호' value='<?=$member[mb_hp]?>'>
<input type=button value='인증번호 전송' class='small' onclick="openWin("<?=$member_skin_url?>/hp_certify.php?hp="+f.mb_hp.value+"&token=<?=$token?>", 200, 200)"/>
<script>
function openWin(url, w, h)
{
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
w=window.open(url, '_blank', width='+w+', height='+h+', scrollbars='no', menubar='no', resizable='no', location='no', toolbar='no', top='+top+', left='+left+', 'false');
w.focus();
}
</script>
답변 3
<input class=m_text type=text name='mb_hp' id='mb_hp' size=21 maxlength=20 itemname='핸드폰번호' value='*** 개인정보보호를 위한 휴대폰번호 노출방지 ***'>
<input type="button" value="send" class="small"
onclick=openWin("http://major.com/hp_certify.php?token=<?=$token?>&hp="+document.getElementById('mb_hp').value+"",200,200)>
<script>
function openWin(url, w, h)
{
//location.href=url;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
w=window.open(url, '_blank', width='+w+', height='+h+', scrollbars='no', menubar='no', resizable='no', location='no', toolbar='no', top='+top+', left='+left+', 'false');
w.focus();
}
</script>
<input class=m_text type=text name='mb_hp' size=21 maxlength=20 <?=$config[cf_req_hp]?'required':'';?> itemname='핸드폰번호' value='<?=$member[mb_hp]?>'>
에서 id값을 주세여 id='mb_hp'
그리구 빨간색 수정부분을 document.getElemenyById('mb_hp').value
로 고쳐보세여
그리고 그전에 mb_hp 인풋박스에 전화번호가 표시되어서 값이 있어야댑니다
오타가 있네요 document.getElementById('mb_hp').value 입니다
다시 말하지만 인풋박스안에 값이 있어야 팝업에도 값이 같이 넘어갑니다