Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

how to send data into function using onclientselectedindexchanged

$
0
0
I can only get this to half work.
I have to iterate through checkboxes, find "Other" one and see if it is checked and then show / hide an input.

I searched your sample code to loop the combobox checkboxes and could not get any of the functions to work. but it may also be the same issue that I did get working.
anyhow here is the code that works when called on page load (not from the combobox itself) to init my hide/show. <-- this code works

functionShowHideTextbox(sender, args, oDropID, oTextID, oLabelID) {
 
    //var ddl = document.getElementById(oDropID);
 
    varoTextbox = document.getElementById(oTextID);
    varoLabel = document.getElementById(oLabelID);
    varbShow = false;
 
    $('#'+ oDropID + ' INPUT').each(function() {
       // alert(this);
        if(this.type == "checkbox") {
            if(this.checked) {
                varsText = this.nextSibling.data;
                if(sText == "Other") bShow = true;
            }
        }
    });
    if(bShow) {
        oLabel.style.display = 'inline';
        oTextbox.style.display = 'inline';
        oTextbox.focus();
    } else{
        oLabel.style.display = 'none';
        oTextbox.style.display = 'none';
    }
}

 

but when this is called from the combobox using the .OnClientItemChecked there are only 2 items in this loop (text + hidden)

it is like the div isn't built out yet. is it calling it too soon to loop the items?

I have verified both calling from page load and combobox sends in the same values.


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>