List Info

Thread: Nesting Forms?




Nesting Forms?
user name
2006-11-21 06:27:23
So I know that you cannot nest forms in HTML as I've found
out today,
but I have a need to do this or get around it.

You can see the admin panel I'm building at:
http://www.juiceboxcommunications.com/admin/subscribers

Click on the empty space in one of the table results to fly
out
complete subscriber data.
In there, there's a submit, I was trying to have a form for
each
subscriber which submits.

I also need a form around the checkboxes though, so I can
handle the
functions in the right panel such as select all, add
selected to
category, etc. etc.

The trouble is, that in my code involves nesting a form
around the
checkboxes (which involves nesting around the rest of the
results).  So
I need a faux way to nest forms, or another workable
solution if anyone
has dealt with this.

the code is like this:


<% for subscriber in subscribers %>
  <%= check_box('subscriber', 'checkBox', :name =>
'subscriber_ids[]',
:id => subscriber.id )%>
  <%= text_field('subscriber', 'firstName', :value =>
subscriber.firstName ) %>
  <%= text_field('subscriber', 'lastName', :value =>
subscriber.lastName ) %>
  etc.
  etc.
<% end %>

If anyone has experience with this, it is much appreciated.

Jason


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups-beta.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---

Nesting Forms?
user name
2006-11-21 09:09:02
You can show your edit form in right sidebar (loading and
saving it
using AJAX)

At current state you can use <%= text_field
"subscriber_#{subscriber.id}", 'firstName' %>
and then parse params
server-side.

to select all checkboxes you can use:
$$("div#results input[type=checkbox]").each(
function(c){c.checked=true} )


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups-beta.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )