Joe Peck wrote:
> Good afternoon to you all,
>
> I have an order form where people can check the fruits they want and
> select the price of each fruit that they have checked.
>
> When I click the checkbox now, it does not seem to affect the
> corresponding price dropdown. What am I doing wrong?
>
> Here's the javascript:
> <script type="text/javascript">
> function toggle_fruit_price(lqname) {
> $(lqname).disabled = (!$(lqname).disabled);
> }
> </script>
>
> Then, inside my loop of @fruits:
> <%= fruit.name %>
> <%= check_box_tag fruit.name, 1, false, :onchange =>
> "toggle_fruit_price(#{fruit.name}_price);" %>
> <%= select_tag("#{fruit.name}_price", options_for_select((0..100))) %>
>
> Does anyone see what I'm doing wrong? Any help is appreciated.
Maybe you can try somthing like this:
if $('lqname').checked == "1"
$('fruit_price_field').show()
--
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---