Keeping focus help -
09-13-2007
, 02:47 AM
Hello,
I think I am close to solivng this, however my limited knowledge is
showing...
very simply, I want to keep focus after focus is given...
---------------------------------------------------------------------
<script type="text/javascript">
function keepFocus(WhichField)
{
document.Form1.WhichField.focus();
}
</script>
<form name="form1">
<input type="text" name="Field1" onFocus="keepFocus('Field1')"/>
</form>
---------------------------------------------------------------------
I don't think i'm using the (WhichField) value correctly. Any help
appreciated.
If you want to offer even "more assistance", then ideally, I would not need
to use onFocus="keepFocus('Field1')". In an ideal world, all input and
select controls onFocus would keep focus.
You might think the above situation seems silly, however when using .NET and
AJAX updatepanels, after a postback, the next field you tab into receives
focus and then immediatly looses it. By using a modified and dumbed down
version of the function above, I was able to overcome the problem. However
I have 60+ form fields, and I am really looking for a way for every field
onFocus to keepFocus.
Any help trully appreciated.
Gary. |