Welcome Guest, Not a member yet? Register   Sign In
how to return a value of one form to another form in the same view.
#1

[eluser]noname525[/eluser]
vv
#2

[eluser]boltsabre[/eluser]
Yeah, when your image upload form is submitted, just do your normal things, and assign your $data with your value and load the view you want to.

Code:
//your image form controller

   // you've done your validation, model stuff etc, now populate your $data
   $data['my_hidden_input_value'] = $image_filename;
   $this->load->view('my_upload_and_members_update_view', $data);

and in your view, just run a php isset() for your variable check in your hidden input
Code:
<input type="hidden" value="<?php if(isset($my_hidden_input_value)) echo $my_hidden_input_value; ?>" />
#3

[eluser]LuckyFella73[/eluser]
When uploading a file via ajax you have a success function
that is fired when you get the expected return value.
You can return a json for example containing the filename
of the file you just uploaded. Take that one and push in
into the hidden input field. Jquery makes it pretty easy.
#4

[eluser]boltsabre[/eluser]
Ah yes rite, i missed the part about ajax. Go with what LuckyFella73 said (but my logic will hold true in a non-ajax/two forms on one page scenario).




Theme © iAndrew 2016 - Forum software by © MyBB