# Observe\_field for two fields

**URL:** <https://www.ruby-forum.com/t/observe-field-for-two-fields/131235>\
**Category:** Rails\
**Created:** [March 7, 2008, 5:22am UTC](https://www.ruby-forum.com/t/observe-field-for-two-fields/131235 "2008-03-07T05:22:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 7, 2008, 5:22am UTC](https://www.ruby-forum.com/t/observe-field-for-two-fields/131235/1 "2008-03-07T05:22:46Z")

</div>

Hi

I have now three select boxes(This is my current structure of  
program)

 Priority \<%= select( "sd\_ticket", "sd\_priority\_id", SdPriority.find(:all).collect {|p| [p.name, p.id] }) %\>

```
<th width="%"><label for="" >Urgency</label></th>
<td width=""><%= select( "sd_ticket", "sd_urgency_id",

```

SdUrgency.find(:all).collect {|p| [p.name, p.id] }) %\>

 Impact \<%= select( "sd\_ticket", "sd\_impact\_id", SdImpact.find(:all).collect {|p| [p.name, p.id] }) %\>

I have to make a change to the above as, based on what value I choose  
for Urgency and Impact the value in Priority is to be changed…So  
Priority is to be replaced by a label box .The table structure as  
below…How can I do this with observe\_field.There is a table for  
sd\_prioritizations.So more clearly The impact and urgency are first read  
from the sd\_impact and sd\_urgency tables.And when user changes the two  
combination of that it is first checked in sd\_prioritization to get  
Priority and the corresponding priority name is read from sd\_priority  
table to get Priority

```
1)sd_impacts
 id integer not null
 name character varying(80)

2)sd_urgencies
  id integer not null
 name character varying(80)

3)sd_priorities
  id integer not null
 name character varying(80)
4)sd_prioritizations
 id integer
 service_desk_impact_id integer
 service_desk_urgency_id integer
 service_desk_priority_id integer

```

Sijo
