hi all,,

i got a little problem here.
with my code below, what i am trying to do is to select the value from
drop down list, and then updating the value of the text field.
However, after updating the value of the text field, the value of the
text field
is not submitted by pressing the submit button.

chapter controllers:
def upload
    @chapter = Chapter.new
    @uploads = Book.find(:all)

  def get_chapter_number
    @books= Book.find(:first,
                      :conditions => ["title = ?", params["title"]])
    render :layout => false
  end
end

views for upload:
<%= javascript_include_tag "prototype" %>
<% form_for (:chapter, @chapter, :url=>{:action =>
"uploadFile"}, :html => {:multipart => true}) do |f| -%>

            <label class="required">series title:</label>
            <select name="upload[title]" id="upload[title]">
            <% @uploads.each do |upload| %>
              <option value="<%= upload.title %>">
                <%= upload.title %>
              </option>
            <% end %>
            </select>

            <label class="required"> chapter: </label>
            <div id="chapter_container">
            </div>

            <%= observe_field("upload
[title]", :update=>"chapter_container", :url=>{:action =>
"get_chapter_number"}, :with => 'title', :on=>"changed") %>

             <%= submit_tag 'Upload', :class => "submit" %>
views for get_chapter_number:
<input type="text" id="upload_number_of_chapters" name="upload
[number_of_chapters]" value= <%= @books.number_of_chapters + 1 %> size
= "30" />

appreciate any help.. thanks,

prawira
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to