Jquery 传checkbox数组到PHP action页面的操作!!!
现在的代码----------------html页面:<divclass="Toolbar_inbox"><php>$st=C('FEEDBACK_STATUS');<...
现在的代码----------------
html页面:
<div class="Toolbar_inbox">
<php>$st = C('FEEDBACK_STATUS');</php>
<select name="fb_status" id="fb_status" onchange="suerSearchFeedback();">
<volist name="st" k="key" id="st_vo">
<option value="{$key}" <php>if($status == $key){echo "selected";}</php>>{$st_vo}</option>
</volist>
</select>
</div>
function suerSearchFeedback(){
var st = $("#fb_status").val();
var fb_url= U('{$admin_app}/Content/feedback' , ['status',st]);
location.href = fb_url;
}
</script>
php action页面代码:
public function feedback(){
$map['fb_status'] = $_GET['status']?$_GET['status']:'0';
$feedDao = D("Feedback");
$rs = $feedDao->getFeedbacks($map);
if($rs)
$rs['status'] = $map['fb_status'];
$sum = $feedDao ->where("fb_status = {$map['fb_status']}")->count();
$this->assign('feedbacks', $rs);
$this->assign('status', $map['fb_status']);
$this->assign('sum', $sum);
$this->display();
}
问题:现在要将下拉列表改成checkbox,通过javascripts读取checkbox数组,然后将数组传到php action页面,针对数组在页面显示符合条件的数据列表。
我自己改的html页面checkbox代码:
<form name="check">
<volist name="st" k="key" id="st_vo">
<input type="checkbox" name="fb_status" id="fb_status" value ="{$key}" <php>if($status == $key){echo "checked";}</php>>{$st_vo}   
</volist>
<input type="submit" id="btn_submit" onclick="suerSearchFeedback()" value="提交">
</form>
js代码:
function suerSearchFeedback(){
var st = $("#fb_status").attr("value");
var fb_url= U('{$admin_app}/Content/feedback' , ['status',st]);
location.href = fb_url;
}
}
</script>
请高手指教! 帮助修改js代码和php action页面代码!!! 展开
html页面:
<div class="Toolbar_inbox">
<php>$st = C('FEEDBACK_STATUS');</php>
<select name="fb_status" id="fb_status" onchange="suerSearchFeedback();">
<volist name="st" k="key" id="st_vo">
<option value="{$key}" <php>if($status == $key){echo "selected";}</php>>{$st_vo}</option>
</volist>
</select>
</div>
function suerSearchFeedback(){
var st = $("#fb_status").val();
var fb_url= U('{$admin_app}/Content/feedback' , ['status',st]);
location.href = fb_url;
}
</script>
php action页面代码:
public function feedback(){
$map['fb_status'] = $_GET['status']?$_GET['status']:'0';
$feedDao = D("Feedback");
$rs = $feedDao->getFeedbacks($map);
if($rs)
$rs['status'] = $map['fb_status'];
$sum = $feedDao ->where("fb_status = {$map['fb_status']}")->count();
$this->assign('feedbacks', $rs);
$this->assign('status', $map['fb_status']);
$this->assign('sum', $sum);
$this->display();
}
问题:现在要将下拉列表改成checkbox,通过javascripts读取checkbox数组,然后将数组传到php action页面,针对数组在页面显示符合条件的数据列表。
我自己改的html页面checkbox代码:
<form name="check">
<volist name="st" k="key" id="st_vo">
<input type="checkbox" name="fb_status" id="fb_status" value ="{$key}" <php>if($status == $key){echo "checked";}</php>>{$st_vo}   
</volist>
<input type="submit" id="btn_submit" onclick="suerSearchFeedback()" value="提交">
</form>
js代码:
function suerSearchFeedback(){
var st = $("#fb_status").attr("value");
var fb_url= U('{$admin_app}/Content/feedback' , ['status',st]);
location.href = fb_url;
}
}
</script>
请高手指教! 帮助修改js代码和php action页面代码!!! 展开
4个回答
展开全部
<input type="<?php echo $input_type ?>" class="Dz_radio" name="<?php echo $input_name ?>" id="checkbox<?php echo $answer->id . '_' . $v; ?>" value="<?php echo $v ?>">
<label for="checkbox<?php echo $answer->id . '_' . $v; ?>"><?php echo $v ?></label>
<label for="checkbox<?php echo $answer->id . '_' . $v; ?>"><?php echo $v ?></label>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
ajax提交过去就可以了!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
目测是ThinkPHP啊,你这样不可行么?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询