Welcome Guest, Not a member yet? Register   Sign In
populating dropdown from previous dropdown
#1

[eluser]sheolikar[/eluser]
Hello sir,

I think i have not explained properly.wht i mean is populating 2nd dropdown from
first dropdown using ajax.
if i have done that but i had kept ajax function in view part and calling another
page from controller.which is not being called.

like this using get function.can anyone give suggestion for what to do.


Code:
function show_name()
{
    var position = document.getElementById("position").value;

    url = "ajax_employee.php?empid";
    ajaxcall(url);
    alert(url);    
}
function handleHttpStateResponse() {
      if (http_request.readyState == 4) {
        // Split the comma delimited response into an array
        results = http_request.responseText;        
        document.getElementById("name_id")[removed] = results;
        }
}        
function ajaxcall(url)
{
       if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

      if(!http_request){
        alert("Your Browser Does Not Support The Features Available in this script");
        return 0;
      }
      http_request.open("GET", url, true);
      http_request.onreadystatechange = handleHttpStateResponse;
      http_request.send(null);              
}


Messages In This Thread
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:11 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:18 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:28 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:39 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:42 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:49 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:53 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 08:55 AM
populating dropdown from previous dropdown - by El Forum - 06-26-2009, 09:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB