How to pass data from a view to a controller? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to pass data from a view to a controller? (/showthread.php?tid=27497) Pages:
1
2
|
How to pass data from a view to a controller? - El Forum - 02-15-2010 [eluser]laytone[/eluser] try this Quote:My controller has the following code: Code: echo "<pre>"; This way you can see all the variables that your form is posting. Maybe in your html the hidden fields are not within your <form></form> tags?.?.? How to pass data from a view to a controller? - El Forum - 02-15-2010 [eluser]theciman[/eluser] Thanks but I tried that with no results. I do believe I have all the form tags correct: <form> </form> <html> <head> <title> TRMC T&E S&T </title> </head> <body> <h1>Database Update</h1> Project Details:<br /> <pre> <form action="http://abc.ef.com/ll/index.php/updateprojects/update_project" method="post"> ...... ...... </form> </pre> </body> </html> The funny thing is when I make the form viewable it works fine. How to pass data from a view to a controller? - El Forum - 02-15-2010 [eluser]laytone[/eluser] Can you post the rendered html view and also the function you are posting to without removing any of the actual code? Quote:The funny thing is when I make the form viewable it works fine. what do you mean by this and how is it that you are hiding it? How to pass data from a view to a controller? - El Forum - 02-15-2010 [eluser]theciman[/eluser] What I meant is I am using a form_hidden which gives me this problem. Once I change the form_hidden to say form_input then everything works fine. This is why I think there is something wrong with the form_hidden function. I am questioning whether one can pass a value to a controller using $this->input->post coming from a form_hidden function. I am told I should be able to pass a value but it does not seem to work. The value is correct in the html code I show above but yet the post shows nothing. Once I make the form visible like a form_input than the value is captured by the post method and I can view it, modify it, and use it to insert values into my database. How to pass data from a view to a controller? - El Forum - 02-15-2010 [eluser]laytone[/eluser] I do it every day. Will you post the html code of your form rendered. from the <from XXX > to the </form> without taking anything out. (the version with hidden fields) I'm sure we will be able to figure out whats wrong very quickly. |