Pass button id to controller from view |
Hey guys can i pass my button id to controller?
I need this to make a select in Model. View button code. Code: <button class="btn btn-primary" data-book-id="<?php echo $historico->codigo ?>" data-target="#form-modal" data-toggle="modal">Visualizar</button> (08-17-2015, 05:37 PM)nofpowells Wrote: Hey guys can i pass my button id to controller? You can set the value attribute of the button Code: <button class="btn btn-primary" name="button_name" value="<?php echo $id_to_set ?>" data-book-id="<?php echo $historico->codigo ?>" data-target="#form-modal" data-toggle="modal">Visualizar</button> PHP Code: $id = $this->input->post('button_name');
(08-17-2015, 06:46 PM)pdthinh Wrote:(08-17-2015, 05:37 PM)nofpowells Wrote: Hey guys can i pass my button id to controller? i'm trying but not work my Controller PHP Code: public function historicochamada(){
Well, to complete my question.
This button open a modal i the same page. How can i call a function in controller using a button? (08-17-2015, 07:58 PM)nofpowells Wrote: Well, to complete my question. It looks like you're opening a modal use javascript / jquery, so you should reference the modal docs. If you want to pass it to a controller (on server side), make sure you put the button on a form. P/s: Sorry for my English
(08-17-2015, 10:34 PM)pdthinh Wrote:Yeah, its a modal. I'm researching, but maybe only with Ajax to populate modal.(08-17-2015, 07:58 PM)nofpowells Wrote: Well, to complete my question. Where you from? (08-17-2015, 11:24 PM)nofpowells Wrote:I'm from Vietnam.(08-17-2015, 10:34 PM)pdthinh Wrote:Yeah, its a modal. I'm researching, but maybe only with Ajax to populate modal.(08-17-2015, 07:58 PM)nofpowells Wrote: Well, to complete my question. |
Welcome Guest, Not a member yet? Register Sign In |