js取得html內的數值 (取得id=T1的數值)

<script type="text/javascript">
function express(){ 
var value1=document.getElementById("T1").value;
}
</script>

<input type="text" class="form-control" id="T1" name="ChickInDate" Value="2017-11-14"">


js 透過iframe 去送Get方式 (list2.php收到值的頁面) 切換下拉式選單 傳送值到list2.php

list2.php

<script type="text/javascript">
function express(){ 
var value1=document.getElementById("T1").value;
var value2=document.getElementById("T2").value;
var roomtype=document.getElementById("ID_ChooseRoomType").value; 
document.getElementById("iframe").src ="list2.php?value1="+value1+"&value2="+value2+"&roomtype="+roomtype; 

}
</script>

<select class="selectpicker" id="ID_ChooseRoomType" name="ROOMTYPE" onchange="express()>
  <option height="1%" value=""></option>
  <option value="StandTwinRoom2Bed">StandTwinRoom2Bed</option>
  <option value="SuperiorRoom1Bed">SuperiorRoom1Bed</option>
</select> 
<iframe src="" id="iframe" width="700" height="500" ></iframe> 

 

list2.php  ($_GET['value1']取得值)

<?php
echo "checkin".$_GET['value1'].'<br>';
echo "checnkout".$_GET['value2'].'<br>';
echo $_GET['roomtype'];
?>

 


 

信用卡判斷

arrow
arrow
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()