Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:11:35+00:00 2026-05-26T10:11:35+00:00

i am new to ajax . i want to submit a data with the

  • 0

i am new to ajax . i want to submit a data with the help of ajax and then get the new data replacing the old one in the same div as of which the old data was .

here is the jquery for sliding tab
$(document).ready(function() {

    // Vertical Sliding Tabs
    $('div#st_vertical').slideTabs({            
        // Options
        contentAnim: 'slideH',
        contentAnimTime: 600,
        contentEasing: 'easeInOutExpo',
        orientation: 'vertical',
        tabsAnimTime: 300                       
    });     

});

ajax

function addhubs()
{
var group =$('#customhubs').val();
var user=$('#loginuser').val();
$.ajax({
type:"GET",
url: 'mfrnds.php?val='+group+'&& loguser='+user,
success: function(html){ 



}
});
}

the div i want to replace data

      <div id="st_vertical" class="st_vertical">

    <div class="st_tabs_container">

        <a href="#prev" class="st_prev"></a>
        <a href="#next" class="st_next"></a>
    <div class="st_slide_container">

            <ul class="st_tabs">
                <?php $sql=mysql_query("select * from groups");
           while($ab=mysql_fetch_array($sql))
            {
           $gpID[]=$ab['group_id'];
           $gp=$ab['group_id'];
           $gpName=$ab['group_name'];
           ?>
                <li><a href="#stv_content_<?php echo $gp;?>" rel="v_tab_<?php echo $gp;?>" class="st_tab "><?php echo $gpName;?></a></li>
                       <?php
              }
              ?>        </ul>                       


        </div> <!-- /.st_slide_container -->

    </div> <!-- /.st_tabs_container -->            

and the mfrnds.php of the ajax call file contains query to update the new data.

    $user=$_GET['loguser'];
    $group=$_GET['val'];
    $sql=mysql_query("insert into groups (group_name) values ('$group')");

how can i update the div in the above . plz help me .m stuck badly luking for solution from 4 days. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:11:35+00:00Added an answer on May 26, 2026 at 10:11 am

    Note that in your addhubs function you should only add one & in your url and concatenate everything without spaces in between such as below.

    When the ajax call has finished it returns the contents of the page you requested (mfrnds.php) in the html variable. So you can simply select the div you want and enter the html as you can see below. So here we go…:

    Your Page

    <html>
    <body>
         <script>
              $(document).ready(function() { 
                  setupTabs(); 
              }); 
    
             function setupTabs() {
                   // Vertical Sliding Tabs     
                   $('div#st_vertical').slideTabs({  
                        // Options         
                        contentAnim: 'slideH',         
                        contentAnimTime: 600,         
                        contentEasing: 'easeInOutExpo',         
                        orientation: 'vertical',         
                        tabsAnimTime: 300                            
                   });   
              }
    
              function addhubs() {
                  var group = $('#customhubs').val();
                  var user = $('#loginuser').val();
    
                  $.ajax({
                      type:"GET",
                      url: 'mfrnds.php?val=' + group + '&loguser=' + user,
                      success: function(html) { 
                          //Get div and display the data in there
                          $('div.st_slide_container).html(html);
    
                          //As your slide effect is gone after you updated this HTML, redo your slide effect:
                          setupTabs();
    
                      }
                  });
              }
    
         </script>
    
         <!-- Vertical div -->
         <div id="st_vertical" class="st_vertical"> 
              <div class="st_tabs_container">          
                   <a href="#prev" class="st_prev"></a>         
                   <a href="#next" class="st_next"></a>     
                   <div class="st_slide_container"> 
    
                        <ul class="st_tabs">
                             <?php 
                             $sql = mysql_query("select * from groups");
                             while($ab = mysql_fetch_assoc($sql)) {
                                  $gp = $ab['group_id'];            
                                  $gpName = $ab['group_name']; ?>                 
                                  <li>
                                       <a href="#stv_content_<?=$gp?>" rel="v_tab_<?=$gp?>" class="st_tab ">
                                            <?php echo $gpName;?>
                                       </a>
                                  </li>
                             <?php
                             }  
                             ?>        
                        </ul>
    
                   </div> <!-- /st_slide_container -->
              </div> <!-- /st_tabs_container -->
         </div> <!-- /st_vertical -->
    </body>
    </html>
    

    So in your mfrnds.php you should have a PHP script that uses the val and loguser GET variables and updates the database. After the database has been updated you should return the updated HTML like the following:

    *mfrnds.php

    <?php
           $user = $_GET['loguser'];     
           $group = $_GET['val'];     
           $sql = mysql_query("insert into groups (group_name) values ('$group')");     ?>
    
                  <ul class="st_tabs">
                         <?php 
                         $sql = mysql_query("select * from groups");
                         while($ab = mysql_fetch_assoc($sql)) {
                              $gp = $ab['group_id'];            
                              $gpName = $ab['group_name']; ?>                 
                              <li>
                                   <a href="#stv_content_<?=$gp?>" rel="v_tab_<?=$gp?>" class="st_tab ">
                                        <?php echo $gpName;?>
                                   </a>
                              </li>
                         <?php
                         }  
                         ?>        
                  </ul>
    

    Note though that this code is basically meant as an example, I don’t know what you want to do exactly in mfrnds.php etc, but I hope this gives you a good idea!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to ajax concept,I want to submit a form without refresh
I want to use the new combobox control of the Ajax control Toolkit. But
I am familier with jQuery,Ajax and JSP Servlets but new to Struts2.I want to
I am using php/ajax to submit a form without page refresh. Here are my
Im using the following ajax code to submit data from a form to a
i have the following view:- <div id = partialWrapper> @using (Ajax.BeginForm(Create, Answer, new AjaxOptions
I want to achieve something like this . Here the page automatically loads new
I am new in jquery and Ajax.I want to send parameters with jquery to
I have a situation where I needed to get data from a form submit().
I've got a page that needs POST data to get an ajax response. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.