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

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.

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

    url = "ajax_employee.php?empid";
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) {
                // 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) {}

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

This would have been better off posted with your original topic here - http://ellislab.com/forums/viewthread/121325/

Is there really any need to double post?

Edit: Damn Fuzz (for some reason you're post didn't appear :-S)

I'm not sure how this ties in with CodeIgniter. Have your tried Googling for it? Probably not, so allow me http://lmgtfy.com/?q=javascript+dynamic+dropdown

or look through the forums, and that thread had actvity about 4 hours ago, so should be easy to find

since i did not got reply i thought it is ignored.actually i was trying with ajax in codeigniter.

[quote author="sheolikar" date="1246045768"]since i did not got reply i thought it is ignored.[/quote]

So anything that doesn't get answered within 2 hours is classed as being ignored?
It's good that you decided to add more information, but you could have done it in the same post, or at least in the same thread
Oh well, you'll know for next time

sure i ll keep this in mind .but could you plz tell how to do with ajax in code igniter

Nope (Not becuase I'm horrible but cause I've never tried, so can't really help)
But there was some code how to do it with ajax in that thread I refered to earlier (I'm assuming it works?)

Theme © iAndrew 2016 - Forum software by © MyBB