Has anyone an idea why the below form
- submits correctly when I click the 'Submit' button
- but does call the 'new' action instead of 'create' when I hit ENTER?
Firstly it may be worth checking the html of the page is valid (view
the source in your browser and copy and paste the complete html into
the w3c html validator - find it with google if necessary).
Assuming html is valid is it possible that Enter is hitting a
different button or link on the page? Does the log give any clues?
I seem to remember a discussion here about this a little time ago, but
I don't remember the result. A bit of searching here and googling may
be useful.
Has anyone an idea why the below form
- submits correctly when I click the 'Submit' button
- but does call the 'new' action instead of 'create' when I hit ENTER?
Well it should be ok to have that submit tag just be a normal submit
tag. Secondly if my memory is correct, passing the html => :action
option is only for setting up a fallthrough for if the user doesn't
have javascript (check what gets generated). You also need to say
something like form_remote_tag :url => {:controller => pages ...
You should confirm that your page has multiple form_tags? as like
form within another(inner forms).
actions is going to the first form action when you are using 2 forms
in your page
You can try with the following
<%=javascript_include_tag "prototype"%>
<form>
<%= text_field :page, :title %>
<%= submit_to_remote 'blah', 'Submit', :url => {:action =>
'create'},:update=>"SS"%>
</form>
<div id="SS"></div>
You should confirm that your page has multiple form_tags? as like
form within another(inner forms).
actions is going to the first form action when you are using 2 forms
in your page
You can try with the following
<%=javascript_include_tag "prototype"%>
<form>
<%= text_field :page, :title %>
<%= submit_to_remote 'blah', 'Submit', :url => {:action =>
'create'},:update=>"SS"%>
</form>
<div id="SS"></div>
You should confirm that your page has multiple form_tags? as like
form within another(inner forms).
actions is going to the first form action when you are using 2 forms
in your page
You can try with the following
<%=javascript_include_tag "prototype"%>
<form>
<%= text_field :page, :title %>
<%= submit_to_remote 'blah', 'Submit', :url => {:action =>
'create'},:update=>"SS"%>
</form>
<div id="SS"></div>