Yii Framework Forum: Autocomplete problem with actionUpdate - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Autocomplete problem with actionUpdate Autocomplete problem Rate Topic: -----

#1 User is offline   phosItc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 12-August 11
  • Location:Cambodia

Posted 26 February 2012 - 08:01 PM

hello all yii friends!Plz help me with autocomplete. my problem is with field that use autocomplete if we select list of customer. In hidden field will get id that we select to put in value. so if we don't select list(mean put it blank) I need the value of hidden field get null too in update form.
this my code
<?php
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
    'name' => 'shipper_id',
	'sourceUrl' => array('Shipper/shipperautocom'),
	'value' =>$model->shipper_id,						    
	'options' => array(
		'showAnim' => 'fold',
		'select' => 'js:function(event, ui){ jQuery("#Booking_shipper_id").val(ui.item["id"]);
					$("#shipper_info").html("<b>Address1:</b> "+ui.item.address1);
					}'
							 
						   
	),
         
));

echo $form->hiddenField($model,'shipper_id');
?>        



hope all of you will reply me soon!! thanks :)
0

#2 User is offline   Pravin Gajera 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 25-October 11
  • Location:India

Posted 26 February 2012 - 11:36 PM

Hi

If you have a used activeform than you can used below

echo $form->hiddenField($model,'shipper_id');

otherwise replace with

echo $form->hiddenField("HiddenName",Value variable);

If you have get shipper_id from url than

echo $form->hiddenField('shipper_id', $_GET['shipper_id']);

Thanks
0

#3 User is offline   phosItc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 12-August 11
  • Location:Cambodia

Posted 27 February 2012 - 01:28 AM

View PostPravin Gajera, on 26 February 2012 - 11:36 PM, said:

Hi

If you have a used activeform than you can used below

echo $form->hiddenField($model,'shipper_id');

otherwise replace with

echo $form->hiddenField("HiddenName",Value variable);

If you have get shipper_id from url than

echo $form->hiddenField('shipper_id', $_GET['shipper_id']);

Thanks


thank! but can u explan me again? I still don't understand! ???
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users