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

  • Home
  • SEARCH
  • 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 8262011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:36:59+00:00 2026-06-08T03:36:59+00:00

I have this triple dropdown which works great from http://roshanbh.com.np/2008/01/populate-triple-drop-down-list-change-options-value-from-database-using-ajax-and-php.html Is it possible to

  • 0

I have this triple dropdown which works great from

http://roshanbh.com.np/2008/01/populate-triple-drop-down-list-change-options-value-from-database-using-ajax-and-php.html

Is it possible to run the function getState below on load as well as having its current onChange? This is for an edit page so some of the dropdowns may have values that need to be already selected.

I have modified the query’s to do what I wish in the external pages but I think the first box needs running when the page loads to make the external query’s work properly.

I have tried adding

 jQuery(document).ready(function() {
jQuery('#networks').trigger('change');
 });

but I think that is the wrong type of loader

 function getXMLHTTP() { //function to return the xml http object
    var xmlhttp=false;  
    try{
        xmlhttp=new XMLHttpRequest();
    }
    catch(e)    {       
        try{            
            xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e){
            try{
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e1){
                xmlhttp=false;
            }
        }
    }

    return xmlhttp;
}


function getState(network) {        

    var strURL="findfolder.php?network="+network+"&perant="+<?php echo $row_rs_doc['parentid']; ?>;
    var req = getXMLHTTP();

    if (req) {

        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                // only if "OK"
                if (req.status == 200) {                        
                    document.getElementById('folderdiv').innerHTML=req.responseText;                        
                } else {
                    alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                }
            }               
        }           
        req.open("GET", strURL, true);
        req.send(null);
    }       
}

and my first select list

     <select  name="network" onchange="getState(this.value)">
  <?php
       do {  
    ?>
    <option value="<?php echo $row_rs_net['idnetworks']?>"<?php if (!(strcmp($row_rs_net['idnetworks'], $row_rs_doc['network']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_net['netname']?></option>
    <?php
      } while ($row_rs_net = mysql_fetch_assoc($rs_net));

    ?>
   </select>
  • 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-08T03:37:01+00:00Added an answer on June 8, 2026 at 3:37 am

    Option 1

    Change:

    <select name="network" onchange="getState(this.value)">
    

    to:

    <select id="network" name="network" onchange="getState(this.value)">
    

    Option 2

    Change:

    jQuery('#networks').trigger('change');
    

    to:

    jQuery('[name="networks"]').trigger('change');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form, in which i need to populate a combo box with
i have this youtube url http://www.youtube.com/watch?v=9N51Etoikfw&feature=youtube_gdata i need to remove the feature parameter and
I have a timer that counts down every second. It works great until the
I have this xml file, how can I create RDF triple from it using
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have function which takes in an parameter of a class called Triple, and
I have a Sinatra::Base webservice which I want to start from a command line
I ran into this answer which had a triple dot syntax in VB.NET that
I honestly have no idea why this is happening. I checked, double-checked, and triple-checked
I have searched on this problem, but have found nothing. I have triple checked

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.