using onblur at a new textfield (out of model)

Hi, i wanna ask about onblur function that will be added into a new textfield, which out of the model?

Really need an inspiration

Thanks :lol:

Will this inspire you? :P Lol

<?php echo CHtml::activeTextField($model, ‘content’, array(‘class’ => ‘content’)); ?>



Yii::app()->clientScript->registerScript(‘effect’, "

$(document).ready(function() {

&#036;('input.content').blur(function() {




", CClientScript::POS_END);


hehe, thanks for suggestion, rookie84…

actually i want that new textfield is filled by the other attributes in the other model.

here’s my code

in Controller

public function actionCekProp ()




		foreach ($sql as $i)


			echo $i->propinsi;



in _form

<script type='text/javascript' src="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.js" ></script>

<script type="text/javascript">



				var cekprop = $("#dokumen_kode_prop").val();


					url: "<?php echo Yii::app()->createUrl('dokumen/cekprop')?>",

					data: "cekprop=" + cekprop,

					success: function(data){







<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(



)); ?>


	<?php echo $form->errorSummary($model); ?>



	<div class="row">

		<?php echo $form->labelEx($model,'kode_prop :'); ?>

		<?php echo $form->textField($model,'kode_prop'); ?>

		<?php echo $form->textField($model,'prop'); ?>

		<?php echo $form->error($model,'kode_prop'); ?>



<?php $this->endWidget(); ?>

</div><!-- form -->

but actually, it still won’t be appeared into $prop… Thanks so much for yr respon again :lol:

It’s clearly solved. I did a mistake with .html() which should be changed with .val()…


It is difficult to suggest anything when I don’t know about the context you are working on. Here’s my suggestion anyway:

Try Firebug or anything like that to see if you form is actually send results.

Try success: function(data) { alert(data); } to see you are actually getting the data

Do console.log to see the results in your firebug.

:D , I’m so sorry for making you confuse with my question, cause I thought i’ve said my context before my coding… ^^'v

Thanks for yr suggestion, rookie84