• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not inserting all values from form

i have form with several radio buttons and several input fields.
One radio button and one input field are not inserted in db. All others work. Since everything is same, what could be a problem? (different id and name of fields of course)

Found it. It seems that I must hace form validation on that fields and then it works? Why is that?


the reason you are having this issue is that you are using the set_value function provided by the form_validation library to generate the values to be inserted into the DB. You will only be able to grab input for fields that have validation rules because set_value is originally meant to be used to repopulate fields with their original values to save the user from having to retype their information. In this context may I suggest using the input library to grab the information you need such that a textbox with the name "username" will be available through the following method call $this->input->post('username'). Don't worry the value returned through this will still have your validation rules applied to it.

Hope this clears up the issue.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.