Cakephp 2.3 如何在cakephp中定义select标记的id?
我制作select标记的cakephp代码是Cakephp 2.3 如何在cakephp中定义select标记的id?,cakephp-2.3,Cakephp 2.3,我制作select标记的cakephp代码是 <?php echo $this->Form->select('User.country_id',array($countries),null,array('id'=>'selection','empty'=>null,'label'=>false,'style'=>'width:231px'));?> 这里我定义了id='selection',但当我在浏览器中检查这个下拉框时,它显示id='Us
<?php echo $this->Form->select('User.country_id',array($countries),null,array('id'=>'selection','empty'=>null,'label'=>false,'style'=>'width:231px'));?>
这里我定义了id='selection',但当我在浏览器中检查这个下拉框时,它显示id='UserCountryId'。这是怎么发生的?因此,我的jquery和javascript无法工作。我认为您的语法不正确。应该是:
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'options'=>array($countries), // this is probably not needed
'id'=>'selection',
'empty'=>null,
'label'=>false,
'style'=>'width:231px'
));
?>
我认为你的语法不正确。应该是:
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'options'=>array($countries), // this is probably not needed
'id'=>'selection',
'empty'=>null,
'label'=>false,
'style'=>'width:231px'
));
?>
我认为你的语法不正确。应该是:
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'options'=>array($countries), // this is probably not needed
'id'=>'selection',
'empty'=>null,
'label'=>false,
'style'=>'width:231px'
));
?>
我认为你的语法不正确。应该是:
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'options'=>array($countries), // this is probably not needed
'id'=>'selection',
'empty'=>null,
'label'=>false,
'style'=>'width:231px'
));
?>
您可以使用以下代码
<?php
echo $this->Form->input('User.country_id',array('type'=>'select','options'=>$countries,'id'=>'selection'));
?>
您可以使用以下代码
<?php
echo $this->Form->input('User.country_id',array('type'=>'select','options'=>$countries,'id'=>'selection'));
?>
您可以使用以下代码
<?php
echo $this->Form->input('User.country_id',array('type'=>'select','options'=>$countries,'id'=>'selection'));
?>
您可以使用以下代码
<?php
echo $this->Form->input('User.country_id',array('type'=>'select','options'=>$countries,'id'=>'selection'));
?>
如果需要Id,请使用php语法
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'id'=>'selection',
'style'=>'width:231px'
));
?>
如果需要Id,请使用php语法
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'id'=>'selection',
'style'=>'width:231px'
));
?>
如果需要Id,请使用php语法
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'id'=>'selection',
'style'=>'width:231px'
));
?>
如果需要Id,请使用php语法
<?php
echo $this->Form->input('User.country_id', array(
'type'=>'select,
'id'=>'selection',
'style'=>'width:231px'
));
?>
选择下拉列表显示的是id='UserCountryId',而不是'selection'。这是怎么回事?我已经用CakePHP2.4.6在我的机器上测试过了。你确定你正在更改正确的视图(add.ctp v/s edit.ctp)?但由于它不起作用,我更改了我的jquery和javascript,所以现在没关系了……选择下拉列表显示的是id='UserCountryId',而不是'selection'。这是怎么回事?我已经用CakePHP2.4.6在我的机器上测试过了。你确定你正在更改正确的视图(add.ctp v/s edit.ctp)?但由于它不起作用,我更改了我的jquery和javascript,所以现在没关系了……选择下拉列表显示的是id='UserCountryId',而不是'selection'。这是怎么回事?我已经用CakePHP2.4.6在我的机器上测试过了。你确定你正在更改正确的视图(add.ctp v/s edit.ctp)?但由于它不起作用,我更改了我的jquery和javascript,所以现在没关系了……选择下拉列表显示的是id='UserCountryId',而不是'selection'。这是怎么回事?我已经用CakePHP2.4.6在我的机器上测试过了。你确定你正在更改正确的视图(add.ctp v/s edit.ctp)?但由于它不起作用,我更改了jquery和javascript,所以现在不重要了。。。