|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
button_to_remote and control valuesI have a partial that has a button_to_remote on it wherein a method in my controller is appropriately executed. In the same partial, but not in any <form> I have a select box with the id of "notesboxselect." Is there any way I can pass the text of what is in this select box, to the method in my controller called by the button_to_remote? Thanks, Janna B <div id="notesdiv" style="float: right;"> Notes: <SELECT name="notesboxselect" id="notesboxselect" style="width: 350px; onKeyDown="fnKeyDownHandler(this, event);" onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A (this, event);"> <OPTION value="" style="COLOR:#ff0000;BACKGROUND-COLOR:#ffff00;"></ OPTION> <option>Subrata</option> <option>Chakrabarty</option> <option>Tiger</option> <option>Software</option> <option>India</option> </SELECT> </div> <%=button_to_remote "Manual Up", :url => { :action => "manup" }, :update => "insideuplog" %> --~--~---------~--~----~------------~-------~--~----~ 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@... To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@... For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: button_to_remote and control valuesOn Jul 9, 1:17 pm, JannaB <mistressja...@...> wrote: > I have a partial that has a button_to_remote on it wherein a method in > my controller is appropriately executed. In the same partial, but not > in any <form> I have a select box with the id of "notesboxselect." > > Is there any way I can pass the text of what is in this select box, to > the method in my controller called by the button_to_remote? Thanks, > Janna B Sounds like the easiest option here would be the :submit option of the various *_remote helpers Fred > > <div id="notesdiv" style="float: right;"> > Notes: <SELECT name="notesboxselect" id="notesboxselect" style="width: > 350px; onKeyDown="fnKeyDownHandler(this, event);" > onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = > "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A > (this, event);"> > <OPTION value="" style="COLOR:#ff0000;BACKGROUND-COLOR:#ffff00;"></ > OPTION> > <option>Subrata</option> > <option>Chakrabarty</option> > <option>Tiger</option> > <option>Software</option> > <option>India</option> > </SELECT> > </div> > > <%=button_to_remote "Manual Up", > :url => { :action => "manup" }, > :update => "insideuplog" > %> 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@... To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@... For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: button_to_remote and control valuesOn Thu, 2009-07-09 at 04:17 -0700, JannaB wrote: > Is there any way I can pass the text of what is in this select box, to > the method in my controller called by the button_to_remote? Thanks, > Janna B button_to_remote takes the same options as link_to_remote. I believe the following will do what you want. > <%=button_to_remote "Manual Up", > :url => { :action => "manup" }, :submit => "notesdiv" > :update => "insideuplog" > %> --~--~---------~--~----~------------~-------~--~----~ 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@... To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@... For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: button_to_remote and control valuesFred, you are SO the man. How do you KNOW all this stuff??? If I work with this for 5 years I won't know what you know. -Janna B. On Jul 9, 9:56 am, Frederick Cheung <frederick.che...@...> wrote: > On Jul 9, 1:17 pm, JannaB <mistressja...@...> wrote: > > > I have a partial that has a button_to_remote on it wherein a method in > > my controller is appropriately executed. In the same partial, but not > > in any <form> I have a select box with the id of "notesboxselect." > > > Is there any way I can pass the text of what is in this select box, to > > the method in my controller called by the button_to_remote? Thanks, > > Janna B > > Sounds like the easiest option here would be the :submit option of > the various *_remote helpers > > Fred > > > > > <div id="notesdiv" style="float: right;"> > > Notes: <SELECT name="notesboxselect" id="notesboxselect" style="width: > > 350px; onKeyDown="fnKeyDownHandler(this, event);" > > onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = > > "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A > > (this, event);"> > > <OPTION value="" style="COLOR:#ff0000;BACKGROUND-COLOR:#ffff00;"></ > > OPTION> > > <option>Subrata</option> > > <option>Chakrabarty</option> > > <option>Tiger</option> > > <option>Software</option> > > <option>India</option> > > </SELECT> > > </div> > > > <%=button_to_remote "Manual Up", > > :url => { :action => "manup" }, > > :update => "insideuplog" > > %> 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@... To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@... For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |