Nick Brutyn wrote:
I want to disable the form when an user submits, I know that u can do
website, and I have a lot of forms like..
<%= start_form_tag :action => 'create' %>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<td width="150" height="18" class="label_required"
<td width="10" height="18"> </td>
<td height="18"><%= text_field 'album_category', 'name'%></td>
<%= submit_tag 'create', 'class' => 'knop' %>
<%= end_form_tag %>
Is there something to automatically put the disable stuff in there when
u place a start_form_tag ??
Here's a blog post that spoke about exactly this issue...
submit_tag also accepts an option :disable_with.
If this is set, the submit_tag is disabled on click, with the button's
text getting changed to the value of :disable_with...
submit_tag "save", :disable_with => 'saving...'
I've never used this, but looking at the rdoc, it seems like that's the
though, and you mentioned you weren't fond of using JS.
Hope this helps!