Help Ajax To Save Textbox Value Using Chtml::link

<?php

$image = CHtml::image(Yii::app()->baseUrl. ‘/images/add.jpg’, “HI”, array(“width”=>“20px”,’’ ,“height”=>“20px”));

echo $form->textField($model,‘cons_cmid’).CHtml::link($image);

?>

Im working with a form right now, I have a textfield where i can type my employee ID and as you can see there’s an “ADD” image beside it. I want to save the textfield value to the database model when the add image was click using AJAX without reloading the current page and if possible how can i do it with two different textfield save at the save time when the add image was clicked.

Hi

Dont write only code. Please explain your requirement. I could not get your point.

From your code i can analyse following points

you have one image link for add functionality and one textfield… with this what you are trying to achieve?

Thank for the reply. Im working with a form right now, I have a textfield where i can type my employee ID and as you can see there’s an “ADD” image beside it. I want to save the textfield value to the database model when the add image was click using AJAX without reloading the current page and if possible how can i do it with two different textfield save at the save time when the add image was clicked.