Hi I have now three select boxes(This is my current structure of program) <tr> <th width=""><label for="" >Priority</label></th> <td width=""><%= select( "sd_ticket", "sd_priority_id", SdPriority.find(:all).collect {|p| [ p.name, p.id ] }) %></td> <th width="%"><label for="" >Urgency</label></th> <td width=""><%= select( "sd_ticket", "sd_urgency_id", SdUrgency.find(:all).collect {|p| [ p.name, p.id ] }) %></td> </tr> <tr> <th width=""><label for="" >Impact</label></th> <td width=""><%= select( "sd_ticket", "sd_impact_id", SdImpact.find(:all).collect {|p| [ p.name, p.id ] }) %></td> </tr> 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi I have now three select boxes(This is my current structure of program) <tr> <th width=""><label for="" >Priority</label></th> <td width=""><%= select( "sd_ticket", "sd_priority_id", SdPriority.find(:all).collect {|p| [ p.name, p.id ] }) %></td> <th width="%"><label for="" >Urgency</label></th> <td width=""><%= select( "sd_ticket", "sd_urgency_id", SdUrgency.find(:all).collect {|p| [ p.name, p.id ] }) %></td> </tr> <tr> <th width=""><label for="" >Impact</label></th> <td width=""><%= select( "sd_ticket", "sd_impact_id", SdImpact.find(:all).collect {|p| [ p.name, p.id ] }) %></td> </tr> 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 sd_impact_id integer sd_urgency_id integer sd_priority_id integer Sijo -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Consider using ''observe_form'' instead. If the two necessary selects are in a form or common container (tr?) you can observe that form for changes and post all the fields back together. The respose could then set the value of the third field. On Mar 6, 11:23 pm, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > > I have now three select boxes(This is my current structure of > program) > > <tr> > <th width=""><label for="" >Priority</label></th> > <td width=""><%= select( "sd_ticket", "sd_priority_id", > SdPriority.find(:all).collect {|p| [ p.name, p.id ] }) %></td> > > <th width="%"><label for="" >Urgency</label></th> > <td width=""><%= select( "sd_ticket", "sd_urgency_id", > SdUrgency.find(:all).collect {|p| [ p.name, p.id ] }) %></td> > </tr> > > <tr> > <th width=""><label for="" >Impact</label></th> > <td width=""><%= select( "sd_ticket", "sd_impact_id", > SdImpact.find(:all).collect {|p| [ p.name, p.id ] }) %></td> > </tr> > > 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 > sd_impact_id integer > sd_urgency_id integer > sd_priority_id integer > > Sijo > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---