dpd3447 2012-09-18 07:36
浏览 8

通过ajax在第一个字段中接收一个结果

i have 3 text field with jquery calender plugin working... the issue I am facing is that in the very first field of input the date pass the ajax function and returns the value from data base via php but the second and the third fields doesn't passes their values to ajax so I am not receiving the value.

the Ajax code is given below

$('.submit-button').on('click',function(){
    var name = $('input#popupDatepicker').val();
    var id = $(this).attr('id').split('_')[1];
    if ($.trim(name,id)!=''){
        $.post('pages/name.php',{name:name,id:id},function(data){
            $('div#name-data').html(data);
            document.getElementById("#name-data").innerHTML =(data);
        });
    }
});

The Html code

> input type="text" class="datecontrol" id="popupDatepicker"

this is the input field and it is replicated in while loop as im getting data from database

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单