Ajax will update a textArea but not a textField

In a CActiveForm I’m using a dropdownmenu to update a textField with ajax, but it won’t update the display in the target field. If I change the field to a textArea though it’ll display the update fine.

I think it might be because in the textField a value=’’ is included in the html. Am I correct? Is there a way around this?

It is possible.

If you use a textarea, you can use:


 

'update'=>'#textareaId'



If you use a textbox, you should try something like:


 

'success'=>'js:function(data)({$("#textfieldId").val(data)});'



//not tested

Thanks for the pointer. The following worked:




'success'=>'js:function(data){$("#textField").val(data)}'