symfony select_tag无法提交ajax
前台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的问题,测了好久了。