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 8644629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:20:44+00:00 2026-06-12T12:20:44+00:00

Myproblem is when I click my first selectbox, after there is a value, it

  • 0

Myproblem is when I click my first selectbox, after there is a value, it will trigger the second selectbox. I implement it in Ajax, but successfully render ,but my other textfield value is gone. How could I just render a specific part of the responde html(success ajax call)?

$(document).ready(function(){ 

    if ($('#product_category').val() == 'Choose Category')
        document.getElementById('product_subcategory').disabled = true;

    $('#product_category').change(function () {   
        if ($('#product_category').val() == 'Choose Category')
            document.getElementById('product_subcategory').disabled = true;
        else
            document.getElementById('product_subcategory').disabled = false;


        data = $('#product_category').val();
        //alert(data);

        var param = 'category_name=' + data;
        $.ajax({
          url: MYURL,
          data: param,
          success: function(result) {
            alert('Choose product subcategory');
            alert(param);
            $('body').html('');
            $('body').html(result);
          }
        });
       //   window.location = MYURL?category_name="+data;
    });

    $('#product_subcategory').change(function () {    
        data = $('#product_subcategory').val();
     //     paramCategory = $(document).getUrlParam('category_name');
      //    alert(paramCategory);

        $.get(MYURL, function(data){
            alert("Data Loaded: " + data);
            });
        //window.location = MYURL?subcategory_name=" +  data;
    });

});

in my form, i use $_GET[‘category_name’] to get my value Ajax return value. I Debug in firebug, and it is successfully. I tried to render again the html, but my previous textarea’s value and textfiel’s value is gone since what i did is $(‘body’).html(”); $(‘body’).html(result);, So,how could I manage to get the success ajax return value, and use it in the PHP.

any confusion ,please tell me…
Thank you for spending ur time.


Hmm, I’m using a div and show the Div when it was return success ajax call.

  • 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-06-12T12:20:45+00:00Added an answer on June 12, 2026 at 12:20 pm

    You have two ways to do it.

    1. Add the text from PhP while returning the data for Ajax call

    2. Add the data back to the text box after loading the page..

      data = $(‘#product_category’).val();
      //alert(data);

      var param = ‘category_name=’ + data;
      $.ajax({
      url: MYURL,
      data: param,
      success: function(result) {
      alert(‘Choose product subcategory’);
      alert(param);
      $(‘body’).html(”);
      $(‘body’).html(result);
      $(‘#product_category’).val(data);
      }
      });

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

Sidebar

Related Questions

I have 2 LinkButtons in my asp.net page. When I click on the first
My problem is that if I click a button and the ajax has not
It is my first experience with git and here is my problem. There is
My problem is that I can only seem to click the button once, if
My problem is when dialog box is showing at that time may i click
this is my button - (IBAction)startBtn:(id)sender { } my problem is, when i click
Hy, my problem is this http://jsfiddle.net/VZ2MK/1/ (function(){ var input = $('.test').clone(); $('a.add_input').on('click', function(e){ $(this).before(input);
here is myproblem, i want to make a php function to insert some random
I working with some ajax at the moment, the result of a successful ajax
My problem is getting the first tab_content to show on load. my jquery: $(document).ready(function()

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.