[SOLVED] How to capture form_hidden ? |
[eluser]solid9[/eluser]
I created a form_hidden Code: form_hidden('swap_id', $swap->id); now I tried to catch it like this below, Code: $swap_id = $this->input->post('swap_id'); After that I echoed it, Code: echo 'ID:', $swap_id; But nothing shows. Why?
[eluser]PhilTem[/eluser]
Try to do a Code: var_dump($this->input->post('swap_id'); to see, if it's not FALSE (which implies, that the post value isn't available). On another point of view: Did you set your form's method to Code: method="POST" otherwise (i.e. with method="GET") you won't be able to access it with input->post. However, hidden fields are just not visible to the user but are valid input fields hence should be within your post-array.
[eluser]solid9[/eluser]
Yes I tried the var_dump and I got this value below, Code: bool(false) Regarding the method="POST" I believed that's already included with the codes below, Code: echo form_open('main/process_post'); It's in the documentation, http://ellislab.com/codeigniter/user-gui...elper.html But then again, please correct me if I'm wrong.
[eluser]InsiteFX[/eluser]
Code: <?php
[eluser]solid9[/eluser]
Thanks insiteFX, I already tried yours but the problem persist. By the way below are the codes of the form Code: <table width="550" border='0'>
[eluser]InsiteFX[/eluser]
And from the looks of it he's using an array for the values and then trying to access them as an object!
[eluser]solid9[/eluser]
Thanks guys specially PhilTem WoW! I forgot the echo. LOL Problem SOLVED. |
Welcome Guest, Not a member yet? Register Sign In |