• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
form action without redirect

#1
Hello guys, I need help here.


I need call a controller/function without redirect.

I need stay in the same page and not reload that page, just call a function in controller.

i don't know if have other methods without using form.

Help me please. 

Thanks for now.


here my code in a modal

PHP Code:
<div class="modal fade" id="add">
 
   <div class="modal-dialog">

 
       <div class="modal-content">
 
       
            
<div class="modal-header">
 
               <button class="close" data-dismiss="modal">
 
                   <span>&times;</span>
 
               </button>
 
               <h4 class="modal-title">Participantes</h4>
 
           </div>

 
           <div class="modal-body row">
 
               <div class="col-md-12" >
 
                   <div class="row text-center"   
                        
<?php echo form_open('webconf/adicionarParticipante'); ?>  
                          <input type="text" name="idChamada" id="idChamada" hidden value="">         
                        <?php foreach ($participantes as $usuario) {?>
                          <?php if($usuario->codigo <> $userID) { ?>
                            <div class="participante" id="imagemChecked">
                                <img class="img-participante" id="imgParticipante" src="<?php echo IMG'h2.jpg' ?>" alt="...">
                                <input type="checkbox" name="imgCheck[]" id="imgCheck" value="<?php echo $usuario->codigo;?>"></input>
                                <h4><?php echo $usuario->nome?></h4>
                            </div>
                          <?php }} ?>                  
                    </div>  
                </div>    
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" >Cancelar</button>
                <button type="submit" id="btn-chamar" class="btn btn-primary" disabled>Chamar</button><br />               
            </div>
                    </form>
        </div>

    </div>
</div> 
Reply

#2
You will need AJAX to accomplish this.
If your website is already using Jquery, this is not difficult at all.

Look here for a few good examples.
Reply

#3
Thanks Man!!!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.