I tried to submit a select at a page without using a submit button
in my view and I come to this, and works all right for me..
controller:
@my_array = [["select one value",-1],["ginger",1],["pepper",2],["mustard",3]]
view:
<% form_for :my_form, :html => {:id => "my_form"},
:url => {:action => :receive_select} do |f| %>
<%= select :selection, :id, @my_array, {:selected => -1},
{:onchange =>"if (confirm(\"Confirm?\")) {this.form.submit();}"} %>
<% end %>
quinta-feira, 22 de janeiro de 2009
Assinar:
Postar comentários (Atom)
Marcadores
- 404 (1)
- Agendador (1)
- Asian movies (1)
- Asus (1)
- Caminhadas (1)
- Capybara (1)
- Comic/Strange (57)
- Computers (20)
- Controller (1)
- Cron (1)
- DBus (1)
- Destroy (1)
- Euler (1)
- Fedora (1)
- G50VT (1)
- Games (1)
- Gráficos (1)
- Hiking (1)
- Japan (1)
- javascript (8)
- Linux (6)
- monokai gedit linux (1)
- Movies (1)
- Mysql (3)
- Netbeans (2)
- Oracle (1)
- OSX (13)
- photos (1)
- Pidgin (1)
- Programming Languages (4)
- PyCron (1)
- Rock climbing (2)
- Ruby (7)
- Ruby on Rails (23)
- Test (1)
- Travessias (1)
- Web (14)
- WhatWeb (1)
- wikipedia (1)
- Windows (1)
- XBMC microsoft game controller (1)
Nenhum comentário:
Postar um comentário