美好生活的朋友们,我不知道如何用这个文本区域更新数据库。有人可以帮忙吗?
ajax 调用
$$('.btn').addEvent('click', function() {
var request = new Request( {
url: '<?php echo $baselink;?>',
method: 'post',
onSuccess:function(responseText) { alert(responseText);},
data: {
'name' : this.id,
'value' : this.value,
'tmpl':'component',
'format':'raw',
'ajax' : 1
}
}).send();});
**//Form//**
$s6=$item['Select6'];
$id=$item['items_id'];
print '<form method="post" class="formulier">
<input maxlength="250" NAME="name" class="name" id="'.$id.'" value="'.$s6.'" SIZE="50">
<input type="submit" value="Click me" class="btn"/></form>';
询问
if(JRequest::getVar('ajax') ) {
$state=JRequest::getInt('value','oeps');
$id=JRequest::getVar('name','');
if ( $id ) {
$state=(int)$state;
$query="UPDATE #__dataitems set `Select6`='".$state."' where `items_id`=".$id;
$db->query();
echo ' Bijgwerkt naar '.$state.' '.$id;
exit;}