Welcome Guest, Not a member yet? Register   Sign In
set_value() not working for hidden fields?
#1

[eluser]Sein Kraft[/eluser]
For some reason this line keeps setting '1' instead '0' like the set_value says.

Code:
echo '<input name="category" type="hidden" value="'.set_value('category', '0').'" />';
#2

[eluser]darrentaytay[/eluser]
Set value requires that you have CI's Form Validation set up for that field - do you have form validation on category?
#3

[eluser]Sein Kraft[/eluser]
[quote author="darrentaytay" date="1305432037"]Set value requires that you have CI's Form Validation set up for that field - do you have form validation on category?[/quote]

Yes, I did.

Code:
$this->form_validation->set_rules('category', 'category', 'trim|required|is_natural');
#4

[eluser]InsiteFX[/eluser]
You riles are wrong!
The secod category should be upper case...
Code:
$this->form_validation->set_rules('category', 'Category', 'trim|required|is_natural');

InsiteFX
#5

[eluser]Sein Kraft[/eluser]
[quote author="InsiteFX" date="1305456460"]You riles are wrong!
The secod category should be upper case...
Code:
$this->form_validation->set_rules('category', 'Category', 'trim|required|is_natural');

InsiteFX[/quote]
PFffffff!!!

My rules aren't wrong. Why people don't read the doncumentation before appear screaming and saying that everything is wrong because it isn't in upper case...

The second argument will be passed as text in the error message to be interpreted by the final user.

User Guide
#6

[eluser]darrentaytay[/eluser]
Yeh you're right, the second parameter is just a label the users see.

Can you post more of the code so we can try and understand the problem a bit better please?




Theme © iAndrew 2016 - Forum software by © MyBB