A
avnrao
Hi,
I am facing a problem with control.focus (javascript). Here is the
description of the issue.
1. I have 2 aspx files. on Aspx1 I have button named NewRow. Clicking on
this, will redirect page to Aspx2 which has a Datagrid. PageLoad of Aspx2
displays the DataGrid with existing data filled in and shows a new row (set
of text boxes) in the Footer Item.
Now, when I set the focus by accessing the first text box in the Footer
Item, focus is not set. Moreover, I am unable to set the focus to that
textbox using mouse.
The textbox is not disabled. I am able to set the focus with mouse when just
use a tab.
When I remove the .focus code from pageload, thought I focus is not set, but
I am able to set focus using mouse for the first time.
Basically what I found out is, when I set the focus onto text box, the focus
has gone to IE menus (File,edit ects..). This is because when pageloads, I
just typed F, it opened File menu in the IE. I am not sure why its behaving
this way.
One more information, when I tried a repro of same problem using another set
of 2 aspx files to check if the issue is coming up there. To my surprise,
the focus is set properly.
I am setting the focus using the following line.
document.getElementById('dgCampaign').rows[document.getElementById('dgCampaign').rows.length-1].cells[0].children[0].focus();
when I alert object id, or innerText, I get the proper values.
How to resolve this issue?? Please do reply if you need any more
information.
thank you,
Av.
I am facing a problem with control.focus (javascript). Here is the
description of the issue.
1. I have 2 aspx files. on Aspx1 I have button named NewRow. Clicking on
this, will redirect page to Aspx2 which has a Datagrid. PageLoad of Aspx2
displays the DataGrid with existing data filled in and shows a new row (set
of text boxes) in the Footer Item.
Now, when I set the focus by accessing the first text box in the Footer
Item, focus is not set. Moreover, I am unable to set the focus to that
textbox using mouse.
The textbox is not disabled. I am able to set the focus with mouse when just
use a tab.
When I remove the .focus code from pageload, thought I focus is not set, but
I am able to set focus using mouse for the first time.
Basically what I found out is, when I set the focus onto text box, the focus
has gone to IE menus (File,edit ects..). This is because when pageloads, I
just typed F, it opened File menu in the IE. I am not sure why its behaving
this way.
One more information, when I tried a repro of same problem using another set
of 2 aspx files to check if the issue is coming up there. To my surprise,
the focus is set properly.
I am setting the focus using the following line.
document.getElementById('dgCampaign').rows[document.getElementById('dgCampaign').rows.length-1].cells[0].children[0].focus();
when I alert object id, or innerText, I get the proper values.
How to resolve this issue?? Please do reply if you need any more
information.
thank you,
Av.