Using the WebCurrencyEdit control with a validator does not SetFocusOnError when an error is encountered. Is there some trick to get this to work?
Hi,
Focus fails because WebTextEdit uses hidden field with id equal to its ClientID. Actual <input> has different id which depends on properties of control. If control does not have buttons (spin, custom), then its id has prefix "igtxt".
So, to trick validators you may override its "focus" function like below
<script type="text/javascript">if(typeof ValidatorSetFocus == 'function'){ window['_oldValidatorSetFocus'] = ValidatorSetFocus; window['ValidatorSetFocus'] = function(val, evt) { var editor = null, old = val ? val.controltovalidate : null; if(old == 'curPayoffAmount') { editor = igedit_getById(old); if(editor) val.controltovalidate = editor.elem.id; // or if editor does not have buttons, then line above // you may replace by // val.controltovalidate = 'igtxt' + old; } window['_oldValidatorSetFocus'](val, evt); if(editor) val.controltovalidate = old; }}</script>