日期:2014-05-17 浏览次数:20565 次
<form name="favForm" id="favForm" action="javascript:void(0)" method="POST"> <input type="hidden" id="hidden_sid" name="part[sid]" value=""> <input type="hidden" id="hidden_uid" name="part[uid]" value="{{$uid}}"> <p bgcolor="blue" style="margin-top:30px;"> {{foreach from=$selectAry item=select}} {{if $select.id == sid}} {{$select.name}} {{/if}} {{/foreach}} <input type="radio" id="is_good_1" name="part[is_good]" value="1"><img src="http://static.h-elab.com/img/xiao.gif"><input type="radio" id="is_good_2" name="part[is_good]" value="0"><img src="http://static.h-elab.com/img/ku.gif"> </p> <div id="isPlist" style="margin-top:4px;"> <p><textarea id='part_text' name="part[text]" cols="28" rows="4" style="padding:3px;font-size:15px;LINE-HEIGHT:18px; height:90px;" onclick="clien();">输入您的看法,字数在50字内</textarea></p> </div> <p> <input type="button" id="favButton" value="确 定" class="pop_but" onclick="sendData();showDiv();"> <input type="reset" id="button" value="取 消" class="pop_but" onclick="showDiv();" style="margin-left:40px;"> </p> </form>
function sendData(){ var uid=document.getElementById('hidden_uid').value; var sid = document.getElementById('hidden_sid').value; var text = document.getElementById('part_text').value; var rideo = document.getElementsByName('part[is_good]'); var is_good; if(text == '' || text == '输入您的看法,字数在50字内'){ alert('请提出您的看法,不然投票无效哦!'); return false; } alert (sid); for(var i=0; i<rideo.length;i++){ if(rideo[i].checked == true){ is_good = rideo[i].value; } } var url = 'http://www.h-elab.com/ajax/part/recode.php'; $.getJSON(url,{uid:uid,sid:sid,text:encodeURIComponent(text),is_good:is_good},function(data){ return true; }); }