Welcome Guest, Not a member yet? Register   Sign In
Auto generated code

I need an auto generated code feild. this function is working properly and generate random code. but problem is i want to display it in my view static so that user can not change it. rite now it is showing in input feild. how to dispaly it without input field. m new in codeigniter plz help me.


[eluser]Sanjay Sarvaiya[/eluser]
there is so many way to do this.
simple way is store in hidden field and display in label instead of input field.

my code is this

<?php if($device_access_code!=""){
$device_access_code = $device_access_code;
$device_access_code = $this->auth->getDeviceCode(5);
} ?>
<label for="device_access_code">&lt;?php echo lang('device_access_code');?&gt;</label>
&lt;?php $data = array('id'=>'device_access_code', 'name'=>'device_access_code',
'value'=>set_value('device_access_code', $device_access_code), 'class'=>'gc_tf1');echo form_input($data); ?&gt;

don't know how to use hidden field there and print if

[eluser]Sanjay Sarvaiya[/eluser]
simple read User guide for form field http://ellislab.com/codeigniter/user-gui...elper.html
echo form_hidden('device_access_code', $device_access_code);

Theme © iAndrew 2016 - Forum software by © MyBB