Jump to content

php or jquery


Go to solution Solved by akphidelt2007,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.