# Auto submit a form

**URL:** <https://www.ruby-forum.com/t/auto-submit-a-form/113667>\
**Category:** Rails\
**Created:** [September 3, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/auto-submit-a-form/113667 "2007-09-03T17:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [September 3, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/auto-submit-a-form/113667/1 "2007-09-03T17:18:51Z")

</div>

I have a use case where a form should be submitted automatically when  
the view is rendered ( a textfield is already filled out by the app)  
can I use a hidden field and an observe\_field on it to detect when it  
has be changed or is there another way of doing it ???

thanks for you help

kad

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [September 3, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/auto-submit-a-form/113667/2 "2007-09-03T19:38:10Z")

</div>

Kad K. wrote:

> I have a use case where a form should be submitted automatically when  
> the view is rendered ( a textfield is already filled out by the app)  
> can I use a hidden field and an observe\_field on it to detect when it  
> has be changed or is there another way of doing it ???
> 
> thanks for you help
> 
> kad

I could imagine something with

function onload() {  
formNAME.submit();  
}

and then
