Is there a way to access the WebDropDown's textbox?
I'm trying to limit the value someone can input to only valid currency amounts with regular expression validators and a FilteredTextBoxExtender. When looking through the source code I found the textbox, but no nice way to access it.
<input id="x:493491774.2:mkr:Input" autocomplete="off" type="text" class="igdd_ValueDisplay " accesskey="" />
Hi,
You may try:
var dropDown = $find("WebDropDown1"); // or what the server ID of the control is
var inputElement = dropDown._elements["Input"];
Hope this helps,
Angel
That helped. Thanks.
On ClientEvents-ValueChanged I got the value of the textbox, and assigned it to a hidden input with attached RegularExpressionValidators.
var dropDown = $find('<%= this.WebDropDownAmount.ClientID %>');var txtBox = dropDown._elements["Input"];var txtValue = txtBox.value;$get('<%= this.AmountCopy.ClientID %>').value = txtValue;
The validation works nicely, but, I still don't have a way of making the textbox the validators' direct ControlToValidate, or of adding a FilteredTextBoxExtender to it.
you can just set the actual WebDropDown as ControlToValidate. You can take a look at our online sample about validation:
samples.infragistics.com => 2009.1 => WebDropDown => Validation
It uses the MS RequiredFieldValidator.
That worked. Thanks.