0
我需要修改使用CakePHP和JQuery在输入表单中创建的标签。将标签修改为输入
$info = "test";
echo $this->Form->input('tipo_de_venta', array('type' => 'select', 'label' => 'Tipo de venta'.$info, 'div' => 'required', 'options' => $opciones_tipo_venta));
我在做什么是设置一个变量$info
用默认值,并更改每次选择更改值的选项。根据选择
$('#tipo_de_venta').on('change', function() {
console.log(this);
if(this.value == 1){
}
if(this.value == 0){
}
if(this.value == 2){
}
});
尝试$(this).text("Change");
但它不适用于我。
HTML:
<div class="required">
<label for="EventoTipoDeVenta">Tipo de venta</label>
<select name="data[Evento][tipo_de_venta]" id="EventoTipoDeVenta">
<option value="0">Compra simple</option>
<option value="1">Change</option>
<option value="2" selected="selected">Compra multiple simplificada</option>
</select>
</div>
您可以添加最初呈现的HTML? – RRK
最初的HTML?你什么意思? – hateful
从页面源加载页面时的输入和其他元素的html。 – RRK