[HELP] Form Generation Library (radiogroup ) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: [HELP] Form Generation Library (radiogroup ) (/showthread.php?tid=51373) |
[HELP] Form Generation Library (radiogroup ) - El Forum - 05-01-2012 [eluser]ci_mohammed[/eluser] hi all this is my first Topic in the forum , i hope to find some help , can some one tell me how to use radiogroup in Form Generation Library. pls some one tell me how to use it in controller and model . i trying to use it but i faced some problem . here is what i do in model Code: $news->isInMain = $data['isInMain']; in controller Code: $isInMain[] = array(1, 'yes'); this it error msgs that i faced ------------------------------------- A PHP Error was encountered Severity: Notice Message: Undefined index: isInMain Filename: models/News.php Line Number: 29 ------------------------------------ ------------------------------------ A PHP Error was encountered Severity: Notice Message: Undefined index: isActive Filename: models/News.php Line Number: 30 ------------------------------------ ------------------------------------ A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: mysql/mysql_driver.php Line Number: 552 ------------------------------------ can some one tell me the problem .. or to tell me how to use it step by step , and i will be very grateful . [HELP] Form Generation Library (radiogroup ) - El Forum - 05-01-2012 [eluser]S-Vizion Software and Development[/eluser] Could you post some more of your code? A undefined index means your array does not have a key named whatever your error is try something like below Code: // Type Cast Variable Data as a Array I personally use a helper function myself that I wrote along time ago to verify that the variable I'm checking is set, not empty, etc to reduce having to write so much extra code checking. Hopefully that will help you get on the correct track. [HELP] Form Generation Library (radiogroup ) - El Forum - 05-01-2012 [eluser]InsiteFX[/eluser] Try removing the colon! Code: 'isInMain:' [HELP] Form Generation Library (radiogroup ) - El Forum - 05-02-2012 [eluser]ci_mohammed[/eluser] mmm the problem is how can i pass the checked value of radiogroup to model ?? then model insert it to database . in controller Code: function addform() in model news.php Code: function add_update( &$form, $data) in view addform.php Code: <?php echo $errors ?> what i need is when i checked yes in isInMain , and press save button , result = 1 . but it is not hapend. [HELP] Form Generation Library (radiogroup ) - El Forum - 05-02-2012 [eluser]ci_mohammed[/eluser] -------------------- A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: mysql/mysql_driver.php Line Number: 552 --------------------- database Code: A Database Error Occurred i should be Code: INSERT INTO `news` (`isInMain`, `isActive`, `can_comment`) VALUES (1, 1, 1) but the value not pass |