Welcome Guest, Not a member yet? Register   Sign In
how to use set_select on a form to show the old value?
#9

(This post was last modified: 05-14-2024, 01:49 AM by kcs.)

I am starting to make sense of what you are saying I think.
My values come from this method:
PHP Code:
    public function edit($id) {
        $this->viewData['booking'] = $this->bookingModel->select('bookings.id as id,status,mode,date,start_time,location,location_zipcode,location_address,presentations_id,clients.id as clients_id, clients.client_name,presentations.pres_name')
            ->where('bookings.id'$id)
            ->join('presentations''presentations_id = presentations.id''inner')
            ->join('clients''clients_id = clients.id''inner')
            ->first();;

            //dd($this->viewData['booking']);
      return view('admin/bookings/edit'$this->viewData);
    

So my edit view is a get request. Do you mean that those functions set_value, set_input, set_checkbox and set_radio are intended to only work after a post? 
So basically when I do have a form I use for edits, that takes data from a call to the database, I cannot use those.  Sleepy  Okay it took me some time but I am getting it now. I thought I could use them here, but that's not the way to go. Thanks for helping me.

May I ask still something though: why do I get a result in my test for the set_checkbox?

Looking at the form_helper, I can see that first all those functions try to get an old value – which is what I was expecting to achieve.
PHP Code:
        // Try any old input data we may have first
        $input $request->getOldInput($field); 

The set_checkbox seems to find it. Not sure exactly then what happens there?
Reply


Messages In This Thread
RE: how to use set_select on a form to show the old value? - by kcs - 05-14-2024, 01:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB