[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to use javascript in rhtml

Advait Bellur

10/25/2007 2:23:00 PM

hello,

I needed to know a javascript function which I can use for focusing my
cursor on the first text field of a given page.

That is as soon as I load a page, my cursor should start blinking in the
first text field

Regards

Advait
--
Posted via http://www.ruby-....

4 Answers

Scott Patten

10/25/2007 4:13:00 PM

0

Advait Bellur wrote:
> hello,
>
> I needed to know a javascript function which I can use for focusing my
> cursor on the first text field of a given page.
>
> That is as soon as I load a page, my cursor should start blinking in the
> first text field
>
> Regards
>
> Advait

If you are loading the prototype javascript library, you add the
following to your view (after the form definition):


<script>Form.focusFirstElement('form_id')</script>

--
Posted via http://www.ruby-....

Advait Bellur

10/26/2007 12:37:00 PM

0

Scott Patten wrote:
> Advait Bellur wrote:
>> hello,
>>
>> I needed to know a javascript function which I can use for focusing my
>> cursor on the first text field of a given page.
>>
>> That is as soon as I load a page, my cursor should start blinking in the
>> first text field
>>
>> Regards
>>
>> Advait
>
> If you are loading the prototype javascript library, you add the
> following to your view (after the form definition):
>
>
> <script>Form.focusFirstElement('form_id')</script>










Thank you for looking into by problem, however the problem still
persists.......I am actually new to this and trying to get a foot
hold...........and didnt get a clear picture of what you ment when you
said
" If you are loading the prototype javascript library, you add the
following to your view (after the form definition) ".

could you please be more clear to me, so that I could you your help to a
much efficient use

Thank you

Advait
--
Posted via http://www.ruby-....

7stud --

10/26/2007 3:35:00 PM

0

Advait Bellur wrote:
> hello,
>
> I needed to know a javascript function which I can use for focusing my
> cursor on the first text field of a given page.
>
> That is as soon as I load a page, my cursor should start blinking in the
> first text field
>

Learn javascript, then write the code to do that. Or, hire someone to
write the js for you.
--
Posted via http://www.ruby-....

Advait Bellur

10/26/2007 4:28:00 PM

0

7stud -- wrote:
> Advait Bellur wrote:
>> hello,
>>
>> I needed to know a javascript function which I can use for focusing my
>> cursor on the first text field of a given page.
>>
>> That is as soon as I load a page, my cursor should start blinking in the
>> first text field
>>
>
> Learn javascript, then write the code to do that. Or, hire someone to
> write the js for you.



Thanks For the suggestion , But I better learn.......thank you once
again

Regards

Advait
--
Posted via http://www.ruby-....