Hi, I'm wondering if there is anyway to check the value of a WebDropDownList control on the client side when it loses focus? I've tried implementing logic on the Focus client side event but it doesn't fire when user changes focus on the control.
I'm have a radio button list inside an updatepanel and depending on the value that is selected from this radio button, the WebDropDown list control is populated with specific values. I need to make sure that a value is selected off of the WebDropDown list before the user can proceed on the form.
Any help would be greatly appreciated.
Thanks.
Hi!
How to do the same thing on server side. i.e Fire some event after the WebDropDown looses focus?
Thanks and regards,
Hitesh
you can use the Blur client-side event to do that. In the handler for that event, you can do any of the below :
sender.get_currentValue(); // current input value text
sender.get_selectedItemIndex();
sender.get_selectedItem();
Hope it helps. Thanks,
Angel
Henry,
Let me know if you have any questions.
hew0n0 said:Hi, I'm wondering if there is anyway to check the value of a WebDropDownList control on the client side when it loses focus? I've tried implementing logic on the Focus client side event but it doesn't fire when user changes focus on the control.
Hello Henry,
You can check / uncheck a value of Item by using code like this below:
<script type="text/javascript" id="igClientScript1">
<!--
function WebDropDown1_Blur(sender, eventArgs)
{
sender.get_items().getItem(1).
element.getElementsByTagName("input" )[0].checked = true ;
}// -->
</script>
I would suggest handle Blur event that will be raised when the control loses focus.