weixin_33670786 2015-07-20 10:59 采纳率: 0%
浏览 18

将ui滑块值传递给php

I want to pass the value of a slider to a php variable in the same document. Although I have tried ajax from online examples it doesnt work and i cant find the solution because im new to ajax and javascript. This is my javascript code:

<script type="text/javascript">
  jQuery_1_1_3(document).ready(function() {
    jQuery_1_1_3( ".slider-vertical" ).slider({
      orientation: "vertical",
      range: "min",
      min: 0,
      max: 2,
      value: 0,
      slide: function( event, ui ) {
        jQuery_1_1_3( "#amount" ).val( ui.value );
        jQuery_1_1_3.ajax(
        {
            type: "POST",
            url: "question.php",
            data:
            {"slider":ui.value}
        });
      }
    });
        jQuery_1_1_3( "#amount" ).val( jQuery_1_1_3( ".slider-vertical" ).slider( "value" ) );

            });
</script>

and i try to fetch the values with this php code:

if(isset($_POST['slider'])){
$vote=$_POST['slider'];
}

Please help me!!!!!!!!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 宇视监控服务器无法登录
    • ¥15 PADS Logic 原理图
    • ¥15 PADS Logic 图标
    • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
    • ¥20 气象站点数据求取中~
    • ¥15 如何获取APP内弹出的网址链接
    • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
    • ¥50 STM32单片机传感器读取错误
    • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
    • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)