Part of the EllisLab Network
   
2 of 2
2
Validation of listbox, checkbox groups and reselect multiple values using set_select, set_checkbox / Sol: Array to string conversion error (line 709)
Posted: 26 August 2008 03:46 PM   [ Ignore ]   [ # 16 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  11303
Joined  06-03-2002

Hey gang, there have been some significant changes to the validation library I thought everyone here would be interested in.

 Signature 
Profile
MSG
 
 
Posted: 26 August 2008 05:18 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  316
Joined  05-08-2008

thank god:)

yeah, ill look at it

Profile
 
 
Posted: 26 August 2008 05:37 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  549
Joined  07-28-2008

Chamone!!!

::goes and grabs a full jar of cookies::

 Signature 

~ 4 All the Right Reasons ~

Profile
 
 
Posted: 25 September 2008 10:06 AM   [ Ignore ]   [ # 19 ]  
Summer Student
Total Posts:  7
Joined  09-15-2008

Hello,
I made those changes in the validation class but still I am getting following notices for Check Box and List Box with multiple values selected.

A PHP Error was encountered

Severity: Notice

Message: Undefined index: cash_codes

Filename: libraries/MY_Input.php

Line Number: 132


My Smarty template code for the check box is
<input type=“checkbox” name=“cash_codes” id=“cash_codes” <!—[if $CASH_CODES_ONLY == “on” ]—>checked<!—[/if]—>>Cash Codes Only
//This is my second check box
<input type=“checkbox” name=“summary_flag” id=“summary_flag”>Summary</td>

Both the check boxes are single and independent.


My code for the list box with multiple selection is as given below.

<select name=“txn_code_list[]” id=“txn_code_list” value=”” multiple=“multiple” size=“15”>
          <!—[foreach item=RESULT from=$RESULTS]—>
          <option value=”<!—[$RESULT.transaction_code]—>”><!—[$RESULT.transaction_code]—> <!—[$RESULT.description]—></option>
          <!—[/foreach]—>
          </select>

It gives following notice.
A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/MY_Validation.php

Line Number: 552

This is my code in controller

$product_code = $this->input->post(‘product_code’);
$summary_flag = $this->input->post(‘summary_flag’);
$user_id_list = $this->input->post(‘user_id_list’);

Can you please guide me how to solve this errors with out suppressing them.

Thank you…

Profile
 
 
Posted: 25 September 2008 10:42 AM   [ Ignore ]   [ # 20 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  801
Joined  04-20-2006

You shouldn’t need this hack since you can use a new Form validation library from SVN. Please be sure to check http://codeigniter.com/forums/viewthread/89251/

 Signature 

Un blog seo white-hat expliquant quelques techniques intéressantes sur le seo black hat

Ionize CMS - Webdesigner CMS based on CodeIgniter
www.ionizecms.com

My website: Webagency Too Pixel

Profile
 
 
Posted: 25 September 2008 04:10 PM   [ Ignore ]   [ # 21 ]  
Summer Student
Total Posts:  7
Joined  09-15-2008

Hello,

Thank you for the prompt reply. With reference to above code #19 after updating the validation class still it gives me the following Notice.

It gives following notice.
A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Validation.php

Line Number: 304 //Before updating it was line number 302 in the original Validation.php file.

How can I get rid of this notice.

Thank you,
Kamal.

Profile
 
 
Posted: 25 September 2008 04:26 PM   [ Ignore ]   [ # 22 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  11303
Joined  06-03-2002

Kamal, you should not be using the Validation class at all.  Please use the Form Validation class referenced in Too Pixel’s link above, including removing any custom class extending you were doing to the old class.  This is a brand new class with new methods and new documentation.  The old Validation class is deprecated and will not continue to be supported.

 Signature 
Profile
MSG
 
 
Posted: 25 September 2008 04:31 PM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  7
Joined  09-15-2008

Thank you very much please don’t spend you time on the Notice. I need to convert my posted array before it runs the validation.

Thank you very much.

Kamal.

Profile
 
 
   
2 of 2
2