symfony select_tag无法提交ajax

wangliucai 2011-11-15 05:33:01
前台listSuccess.php

<?php use_helper('Javascript')?>
<?php sfContext::getInstance()->getResponse()->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); ?>

<table>
<tr>

<td>

<?php

$id = '89003041';
echo select_tag('domain', options_for_select(Array('0' => '84570000','1' => '89003041', '2' => '89003050')),
array(
'onchange' =>
remote_function(array(
'update' => 'item_domain',
'url' => 'ajax2/update')
)
) )
/*
echo select_tag('domain', options_for_select(Array('0' => '84570000','1' => '89003041', '2' => '89003050')),
array(
'onchange' =>
remote_function(array(
'update' => 'item_domain',
'url' => 'ajax2/update',
'with' => "'id=' + $id"))
) )
*/


?>

</td>
</tr>

<tr><td>
<div id="item_domain" style="color:#FF0000"></div>
</td></tr>
</table>


actions.class.php



<?php

/**
* ajax2 actions.
*
* @package ep
* @subpackage ajax2
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class ajax2Actions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
$this->forward('ajax2', 'list');
}
public function executeList()
{
}
public function executeUpdate()
{
echo "abcde";
/*
$a = $this->getRequestParameter('id');
echo "<script>alert('$a');</script>";
$sql = "select * from nummanage where telno = ".$a."";
$rs = mysql_query($sql);
$tc = mysql_fetch_assoc($rs);
$did = $tc['did'];

$sql = "select * from diqu where did = ".$did."";
$rs = mysql_query($sql);
$tc2 = mysql_fetch_assoc($rs);
$rest = "地区:".$tc2['name'];
return $this->renderText($rest);

*/
}
}


可以显示下拉菜单,但就是提交不到actions.class.php中去。好像是ajax的问题,测了好久了。
...全文
29 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
Framework
创建于2008-08-27

4245

社区成员

国内外优秀PHP框架讨论学习
申请成为版主
帖子事件
创建了帖子
2011-11-15 05:33
社区公告
暂无公告