从javascript数组中获取值并将其放入php变量中

I use daterangepicker() to get two dates ( begginning and ending ), I'd like to put those dates in php variables.. i've succeeded to do an alert() to show those variables using a button.. but i don't know how to put them in the php. here's my code if anyone have an idea..


<script type="text/javascript">

$(function(){
    $('#rangeBa, #rangeBb').daterangepicker();
 });
function test(){
    var dates = new Array();
    dates[0] = document.inputdate.rangeBa.value;
    dates[1] = document.inputdate.rangeBb.value;
    return dates; 
}

</script>

<body>
    <form name="inputdate" method="post">
        <input type="text" value="m/jj/aaaa" id="rangeBa" name="rangeBa"/>
        <input type="text" value="m/jj/aaaa" id="rangeBb" name="rangeBb"/>
    </form>
    <button onclick="alert(test())">Click on this button</button>

</body>
查看全部
dongyi6183
dongyi6183
2013/05/16 14:26
  • php
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复