# Disabling a form if a url param is not present

**URL:** <https://www.ruby-forum.com/t/disabling-a-form-if-a-url-param-is-not-present/150294>\
**Category:** Rails\
**Created:** [October 7, 2008, 12:23am UTC](https://www.ruby-forum.com/t/disabling-a-form-if-a-url-param-is-not-present/150294 "2008-10-07T00:23:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ressister](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@ressister](https://www.ruby-forum.com/u/ressister)\
**Post date:** [October 7, 2008, 12:23am UTC](https://www.ruby-forum.com/t/disabling-a-form-if-a-url-param-is-not-present/150294/1 "2008-10-07T00:23:03Z")

</div>

Hi there, I’ve used Javascript in the past to disable form fields, but  
I’m wondering if there’s a way to easily do this with Rails during the  
page generation.

In my app, i have a page that has a form. I want to disable the form  
if a set of URL parameters are not present. I could perhaps do some  
javascript onload function that disables all the form fields, or add  
conditional logic to the rails template which would be messy.

What’s the best way to handle this? I have about 6 fields in the form  
that I want disabled if the url params aren’t present.

Thanks,  
-A
