For a long time now I've used a dependable Javascript function to preselect the text in a textbox. However I discovered today that when a textbox resides in an AJAXifield RadWindow, a more complex approach has to be used. Here's the code showing both approaches:
I'm wondering if there's a way to test for whether the textbox sits within a RadWindow? If so, then I could just call one function and let it decide which approach to use.
Sincerely,
Robert W.
function
SetFocusAndSelectText(tbID) {<br>
var
textBox = $get(tbID);<br><br>
// Standard approach<br> textBox.focus();<br> textBox.select();<br><br><br> // Approach when the TextBox resides in an AJAXified RadWindow<br> // function f() {<br> // debugger <br> // if (textBox != null) {<br> // textBox.focus();<br> // textBox.select();<br> // }<br><br> // Sys.Application.remove_load(f);<br> // }<br><br> // Sys.Application.add_load(f);<br> }
I'm wondering if there's a way to test for whether the textbox sits within a RadWindow? If so, then I could just call one function and let it decide which approach to use.
Sincerely,
Robert W.