![]() |
Auto generated code - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Auto generated code (/showthread.php?tid=53978) |
Auto generated code - El Forum - 08-16-2012 [eluser]saima[/eluser] 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. thanks Auto generated code - El Forum - 08-16-2012 [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. Auto generated code - El Forum - 08-16-2012 [eluser]saima[/eluser] my code is this <?php if($device_access_code!=""){ $device_access_code = $device_access_code; }else{ $device_access_code = $this->auth->getDeviceCode(5); } ?> <label for="device_access_code"><?php echo lang('device_access_code');?></label> <?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); ?> don't know how to use hidden field there and print if Auto generated code - El Forum - 08-16-2012 [eluser]Sanjay Sarvaiya[/eluser] simple read User guide for form field http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html Code: echo form_hidden('device_access_code', $device_access_code); |