Hi,
Anybody know why :onchange works here...
<%= select_tag "Minisections",
options_from_collection_for_select(@minisections, :id, :title, :selected
=> @minisection.id), {:onChange => "{alert('Minisection has been changed
to x !')}"} %>
but NOT here (to call a function)...
<script type="text/javascript">
function xyz() {
"{alert('Minisection has been changed to x !')}"}
</script>
<%= select_tag "Minisections",
options_from_collection_for_select(@minisections, :id, :title, :selected
=> @minisection.id),
{:onChange => "xyz()"} %>
The function is at the top of the .html.erb page. I have used a similar
format with :onclick and it works fine.
Thanks,
DC
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment