Welcome Guest, Not a member yet? Register   Sign In
Form Validation for Input Radio
#1

Helo,

I get a problem with my codes.

I am creating a codes to do edit the data. If user edit the data, it should perform a validation. If it is return false, it will back to the form and give a notification. The submitted value in the field will be return in the form. But, it didn't return the submitted value in input radio.

What wrong with my codes ?

Please give me to solve this problem.


This is my codes for

- the controller : http://pastebin.com/HY2XrX5w

- the models : http://pastebin.com/YF8igE3R

- the views : http://pastebin.com/41N48rZx


Thank you
Reply
#2

(This post was last modified: 01-29-2015, 05:52 AM by FaraonX.)

Hmm on first look... Try this:

PHP Code:
'published' => array(
 
         'name'        => 'product_status',
 
         'id'  => 'product_status',
 
   'value'     => 1,
 
   'checked'   => if($form_value['product_status'] == 1){ TRUE } else { FALSE }
 
 ),
 
 'notpublished' => array(
 
         'name' => 'product_status',
 
         'id' => 'product_status',
 
   'value'     => 0,
    
'checked'   => if($form_value['product_status'] == 0){ TRUE } else { FALSE }
 
 ), 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB