Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Get tbCustom controls from Client side javascript
posted

I'm trying to get the text value from a WebCombo that is inside a tbCustom object on an UltraWebToolbar so if it is empty I can cancel the postback. 

I can get a reference to the tbCustom object (tbSearchBox) by using the Toolbar.Items.fromKey method as below but I don't know how to reference the WebCombo which is inside the tbCustom object.  Is this possible?

// If the search box is empty then dont search!
function
onClickToolbar(oToolBar, oItem, e) {
  if (oItem.Type == 0 && oItem.Key == "tbSearchButton") {
    var searchBoxItem = oItem.Toolbar.Items.fromKey("tbSearchBox");

    //var cbo = ig.getElementById(searchBoxItem.Id);
   
var cbo = igcmbo_getComboById(searchBoxItem.Id);

    if (cbo.getText() == "")
     
e.cancelPostBack = true;
 
}
}

Thanks
Andy