I'm developing a system with the part of the discount, so I wanted the user to type the discount and after that it would validate if it has or not and the percentage of the discount appears.
$cupom = $this->input->post('cupom_desconto');
$desconto = $this->desconto_model->buscarDesconto($cupom, $atividade_codigo);
This is the way I am doing, but this way is sending the request to another page and I would like it to be done on the same page, example of Netshoes and others that we put the code and if it is valid appears in the same page the value of discount, if it has, otherwise it does not change anything.