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的问题,测了好久了。
...全文
60 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧