English 中文(简体)
有可能在届会期间增加数值。
原标题:Is it possible to add values to SESSION w/ jQuery
  • 时间:2011-09-16 17:34:10
  •  标签:
  • php
  • jquery

我的表格有多个物品,每个条目都有带有笔记识别材料的检查箱。

在选定单一检查箱或所有检查箱时,我需要拿到项目编号,并将之添入网站。 目前,我有以下代码选择所有检查箱:

var checkboxes = $(".chkbx").change(function() {
    var allIsChecked = checkboxes.length === checkboxes.filter(":checked").length;
    all[0].checked = allIsChecked;
    enableMyElement(checkboxes.filter(":checked").length > 0);
    putInSession($(this).val());
});
var all = $("#checkall").change(function() {
    checkboxes.attr("checked",this.checked);
    enableMyElement(this.checked);
});

function putInSession(id) {
    $.ajax({
        url: actions.php,
        type: "POST",
        data: "action=addToSession&ID="+id;                 
    });
}   

<input id="checkall" type="checkbox">
<input class="chkbx" type="checkbox" value="360" name="delCont[]">
<input class="chkbx" type="checkbox" value="500" name="delCont[]">
<input class="chkbx" type="checkbox" value="510" name="delCont[]">

我如何用 j子更新我的购买力平价会议? 是否可能? 有哪些替代办法?


最新资料:

大韩民国、阿贾克斯显然是前进的道路。 增加新的职能,将InSession(InSession)(a)。 尚不清楚如何与我的选择性万分性融合......

最佳回答

您可使用一个字节,在届会前添加该项目。

问题回答

与其他人一样,也使用jQuery 。 查阅网站 :,用于辅导。

Call a PHP script through ajax:

$.ajax({
    url:  script.php ,
    data: {
        session_var :  bla_bla_bla 
    }
});

这应当做到。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签