# Accessing form element on load

**URL:** <https://www.ruby-forum.com/t/accessing-form-element-on-load/189731>\
**Category:** Rails\
**Created:** [June 6, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/accessing-form-element-on-load/189731 "2010-06-06T12:20:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4bbf92/32.png) [@vijay](https://www.ruby-forum.com/u/vijay)\
**Post date:** [June 6, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/accessing-form-element-on-load/189731/1 "2010-06-06T12:20:35Z")

</div>

This is the form and link i have in html.  
\<%= link\_to\_function “sample”, “update\_timer()” %\>

onload of the page, i was showing the timer the update\_timer()  
function.

while the page gets loaded the script was called , but the value was  
not written to the text field.  
But when clicking i was able to see the time in the text\_field.  
Could anyone suggest me a solution for this.
