Intersoft WebCombo Documentation
How-to: Use OnAddItem client side event to validate input
See Also Send comments on this topic.
Intersoft WebCombo > WebCombo Features Overview > Dynamically Add Item How-to Topics > How-to: Use OnAddItem client side event to validate input

Glossary Item Box

In WebCombo, you can use OnAddItem Client-side event to validate input. 

This topic will show you how to use OnAddItem client side event.

To validate input using OnAddItem Client-side event

  1. Right click the WebCombo instance and choose WebCombo.NET Designer.
  2. Set OnAddItem to "DoAdd" in Advanced Settings - LayoutSettings - ClientSideEvents.
  3. In HTML view, put the following function:

    JavaScript Copy ImageCopy Code
    function DoAdd(controlId) 
    {       
        var combo = ISGetObject(controlId);
        if(combo.TextObj.value == "Brad")
        {
           return True;
        }
        else
        {
           return false;
        }
    }

  4. Run the project.

See Also