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 02:46 PM   [ Ignore ]   [ # 16 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19292
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 04:18 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  283
Joined  05-08-2008

thank god:)

yeah, ill look at it

 Signature 

mit freundlichen Grüßen, Herr Kaleun

iScaffold - Check this out, it saves time smile

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

Chamone!!!

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

 Signature 

~ 4 All the Right Reasons ~

Profile
 
 
Posted: 25 September 2008 09: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” style=“width:200px”>
          <!—[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 09:42 AM   [ Ignore ]   [ # 20 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  833
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 

All CodeIgniter resources into one place?
http://www.codeigniterdirectory.com

Buildon.net - The PHP Frameworks Showcase - Add your links!
http://www.buildon.net

My website: Création de sites Genève, Too Pixel

Profile
 
 
Posted: 25 September 2008 03: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 03:26 PM   [ Ignore ]   [ # 22 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19292
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 03: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
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120269 Total Logged-in Users: 34
Total Topics: 126397 Total Anonymous Users: 4
Total Replies: 664725 Total Guests: 346
Total Posts: 791122    
Members ( View Memberlist )