I've an input box
<input type = "text" name = "MyInput" value = "">
and a selection
<select name = "MySelectio n" size = "1">
<option value = "1">Entry 1
<option value = "2">Entry 2
</select>
With
document.MyForm .MyInput.focus( );
document.MyForm .MyInput.select ();
I can set the focus to the input box and select the whole text. But if I set
the focus to the selection box with
document.MyForm .MySelection.fo cus();
the text in the input box is still selected.
How can I unselect this text?
Stefan
PS: One possibility would be to add a hidden input box and to set the focus
to this hidden box before I set the focus to the selection. But I think this
would only be a workaround.
<input type = "text" name = "MyInput" value = "">
and a selection
<select name = "MySelectio n" size = "1">
<option value = "1">Entry 1
<option value = "2">Entry 2
</select>
With
document.MyForm .MyInput.focus( );
document.MyForm .MyInput.select ();
I can set the focus to the input box and select the whole text. But if I set
the focus to the selection box with
document.MyForm .MySelection.fo cus();
the text in the input box is still selected.
How can I unselect this text?
Stefan
PS: One possibility would be to add a hidden input box and to set the focus
to this hidden box before I set the focus to the selection. But I think this
would only be a workaround.
Comment