Jump to content

php or jquery


DrTrans

Recommended Posts

Backstory. 

 

Im using Bootstrap Modal's , and i have a modal that opens up a file called test.php

 

 

<script type="text/javascript">
  $("a[data-toggle=modal]").click(function(data1) 
{   
    
    var a_id = $(this).attr('id');
    $('#appcontent').show().html('<p><img src=\"../images/loader.gif\" width=\"19\" height=\"19\" /></p>');
     
    if(a_id >= 0) {
    $.ajax({
        cache: false,
        type: 'POST',
        url: 'ajaxc/test.php',
        data: 'id='+a_id,
        success: function(data1) 
        {
            $('#runtest').show();
            $('#appcontent').hide();
            $('#appcontent').show().html(data1);
        }
    });
    };
});
 
  </script> 
 
 

 

 

inside test.php i have a form

 

 

 
<?php
$submit = $_POST['submit'];
 
if($submit) { 
print " I should be in the same modal box";
}
?>
 
<form action = "test.php" method="post">
<input name="blah">
</form>
 

 

When i submit this form it completely reloads the page all together.... and is not keeping it within the original modal box.  How do i go about making the form submit within the modal box and basically i should see " i should be in the same modal box " without the box closing.

 

 

Link to comment
https://forums.phpfreaks.com/topic/277465-php-or-jquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.