Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Autofill Textfield With The Application Data

$
0
0
i have integrated fb-connect with my yii application. i want user to register via fb-connect and store their information in our database. so, after the fb permission is granted i want new user to be redirected to registration page. and the form should get auto filled with username, email id etc.

i have added this in model:

public function emailid()
	{
	$models=Yii::app()->user->email;
	$abc =array( array('value1'=>$models,'value2'=>'abc'));

	$emailid = CHtml::listData($abc, 'value1', 'value1');
	return $emaild;
	}


and in view:

[indent]<div class="row">
        <?php echo $form->label($model,'email'); ?>
        <?php echo $form->textfield($model,'email',$model->emailid()) ?>
		<?php echo $form->error($model,'master_key'); ?>
    </div>[/indent]


but i cant see the information being filled in the textbox.

however if use "dropDownList" instead of textField then that's displaying the info.

[indent]<div class="row">
        <?php echo $form->label($model,'email'); ?>
        <?php echo $form->dropDownList($model,'email',$model->emailid()) ?>
		<?php echo $form->error($model,'master_key'); ?>
    </div>[/indent]


help me set the information in text field. thanks

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>