/    Sign up×
Community /Pin to ProfileBookmark

Problem with Focus

Hi all,

I am facing problem while using focus function. I have a table with around 100 rows with radio button for each record. The selection of the radio button is based on some calculation and so any of the row will be selected depending the response from servlet. I want to scroll the scroll bar automatically to the selected row.

I have used the following code but it is not working.

<script type=”text/JavaScript”>
function doFocus(){

document.getElementById(‘RadioSelected’).focus();

}
</script>
<body bgcolor=”#D9E1DD” onload=”doFocus();”>
……
……
<%if(AcTpRowBean[i].getChecked().equals(“checked”)){ %>
<input id=”RadioSelected” name=”RadioSelected” checked=”checked” value=”01″ type=”radio” onBlur=”doCheck(this);”>
……..
…….
</body>

can anybody help me to sort it out.

thanks in advance
ananda

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJun 17.2008 — window.scrollTo(0, document.getElementById('RadioSelected').offsetTop);
×

Success!

Help @cab007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...