Web Development

Bug in Safari 3 beta: hidden file fields don't get submitted

I've just wasted several hours due to what turned out to be a bug in the current Safari 3 beta (on OSX Tiger). If you have a form with some DIVs set to display:none;, any file fields that are in the hidden DIVs do not get submitted along with the rest of the data, whereas text fields are submitted. This inconsistency does not exist in Firefox 2 - it submits all of the available fields. Bad Safari, bad!

Tags: 

Reminder - rails forms with file uploads

Just a quick reminder for myself: if you're doing a form that is uploading files, remember to add :multipart => true to the form tag, e.g.:
[source:ruby]
< % form_for(:product, :url => products_path(@product), :html => {:multipart => true, :method => :put }) do |f| %>

< %= f.file_field :photo %>

< % end %>
[/source]

Tags: 

Insanely easy tabbed web pages with Prototype

I came across this today when trying to find an easier way to present a six-part form in a Rails project - a tabbed interface system built upon Prototype (an integral part of Rails). Called Control.Tabs it makes tabbed interfaces a synch to do: simply add an unordered list containing links to the blocks containing your to-be-tabbed content, and add a line of JavaScript to start the ball rolling - that's it!

Tags: 

Pages

Subscribe to Web Development