auto fill a field from input box - 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: auto fill a field from input box (/showthread.php?tid=49456) Pages:
1
2
|
auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Hi Guys, I have a input field that when you press submit it opens a form and I want to get the email the customer first enters in the input Code: So this is the input I'm talking about so whatever anyone enters in here: I want it get the value and then post it to this full form: Code: ?php echo form_open('contact/send'); ?> Thanks for reading, and any help appreciated. auto fill a field from input box - El Forum - 02-20-2012 [eluser]mbrzuzy[/eluser] You could use flashdata to pass it back and set it in your form. Code: $this->session->set_flashdata('email', $this->input->post('email')); Code: $email = array('name'=>'email','id'=>'email','size'=>25, 'value' => $this->session->flashdata('email')); auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Yes i did try that previously but its doesn't seem to want to work. auto fill a field from input box - El Forum - 02-20-2012 [eluser]CroNiX[/eluser] When they submit that form, in that controller, grab the post data and send it to another function which passes it to the view. Hard to tell the data flow from the little code you provided. I don't understand why you have form elements in your anchor (first code). That won't work. Form elements only get sent from within <form></form> tags unless you are using javascript or something. auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Hi Chronix, yes i was thinking that and the form elements are wrapped in <form> tags i only showed the part that i need help on rather the whole thing, but <form></form> is there. So maybe i'll try what you said auto fill a field from input box - El Forum - 02-20-2012 [eluser]CroNiX[/eluser] Code: <form action="/some_controller/some_method"> Code: class Some_controller extends CI_Controller { Code: //grab the $email and display it in the new form auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Cheers chronix your a legend! auto fill a field from input box - El Forum - 02-20-2012 [eluser]CroNiX[/eluser] Ha! No, I've just been coding in one way or another for over 30 years. Started with BASIC on my dads TRS-80 Model 2 in the early 80s. Think he still has it somewhere...he never tosses anything computer-related He has a 5 MB harddrive that is as big as a modern PC. It was one of the first consumer hd's. Thanks, now I feel old. auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Epic! Some vintage stuff you got there, eBay springs to mind lol auto fill a field from input box - El Forum - 02-20-2012 [eluser]the_unforgiven[/eluser] Chronix - any idea why im getting this: Severity: Notice Message: Trying to get property of non-object Filename: libraries/Form_validation.php Line Number: 320 Fatal error: Call to a member function load() on a non-object in /Applications/MAMP/htdocs/new/system/libraries/Form_validation.php on line 320 |