# Focusing wedget using javascript PROBLEM

**URL:** <https://www.ruby-forum.com/t/focusing-wedget-using-javascript-problem/117888>\
**Category:** Rails\
**Created:** [October 22, 2007, 5:26am UTC](https://www.ruby-forum.com/t/focusing-wedget-using-javascript-problem/117888 "2007-10-22T05:26:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![advait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@advait](https://www.ruby-forum.com/u/advait)\
**Post date:** [October 22, 2007, 5:26am UTC](https://www.ruby-forum.com/t/focusing-wedget-using-javascript-problem/117888/1 "2007-10-22T05:26:12Z")

</div>

Hello,

I needed to know, using javascript along with rails, that is in an rhtml  
file how do i make the focus of the widget on the first field when a  
given page is loaded.

I have two problems

1 =\> I would like to know if there is a general functionality written in  
a given application , if so in which file does it exist

2 =\> If I have to write this for individual pages…that is individual  
rhtml page, how do I write this.

Thank You

Advait
