Pito Salas
2010-Apr-02 15:02 UTC
Is it possible to have a form without a submit tag in rails?
This is probably a stupid question but I am confused... I see an example in the 3d Edition of Agile Dev with Rails (page 539) where a simple calculator view, with two text boxes for numbers and a dropdown for what operation to perform, does not mention a submit button or gesture. I don''t understand that. Yes, the form_tag does indicate an :action => , but what triggers that if there is no <%= submit_tag ''Save'' %>? Thanks! Pito -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Apr-02 16:58 UTC
Re: Is it possible to have a form without a submit tag in rails?
> This is probably a stupid question but I am confused... > > I see an example in the 3d Edition of Agile Dev with Rails (page 539) > where a simple calculator view, with two text boxes for numbers and a > dropdown for what operation to perform, does not mention a submit > button > or gesture. > > I don''t understand that. Yes, the form_tag does indicate an :action > => , > but what triggers that if there is no <%= submit_tag ''Save'' %>?Browser dependent, but usually if you hit ENTER while in a text field it will submit the form. Or perhaps that form''s submission is being triggered via javascript. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Srijith nair
2010-Apr-02 17:53 UTC
Re: Is it possible to have a form without a submit tag in rails?
There may be chance of form without submit button .. In your example might be form is submitting in script by using the javascript function submit() inside the script tag, when any of the field changed inside the form <script> $("#student_name").change(function(){ $("#sree").submit() }) </script> <form id=''sree''> <%=text_field ''student'',''name''%> </form> Pito Salas wrote:> This is probably a stupid question but I am confused... > > I see an example in the 3d Edition of Agile Dev with Rails (page 539) > where a simple calculator view, with two text boxes for numbers and a > dropdown for what operation to perform, does not mention a submit button > or gesture. > > I don''t understand that. Yes, the form_tag does indicate an :action => , > but what triggers that if there is no <%= submit_tag ''Save'' %>? > > Thanks! > > Pito-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Pito Salas
2010-Apr-03 15:11 UTC
Re: Is it possible to have a form without a submit tag in rails?
Philip Hallstrom wrote:>> but what triggers that if there is no <%= submit_tag ''Save'' %>? > Browser dependent, but usually if you hit ENTER while in a text field > it will submit the form. > > Or perhaps that form''s submission is being triggered via javascript.Hi Phillip There''s no javascript, but I think the default submit via ENTER must be what was intended. I didn''t know about that. Thanks! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Apr-03 16:09 UTC
Re: Re: Is it possible to have a form without a submit tag in rails?
On 3 April 2010 16:11, Pito Salas <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Philip Hallstrom wrote: >>> but what triggers that if there is no <%= submit_tag ''Save'' %>? >> Browser dependent, but usually if you hit ENTER while in a text field >> it will submit the form. >> >> Or perhaps that form''s submission is being triggered via javascript. > > Hi Phillip > > There''s no javascript, but I think the default submit via ENTER must be > what was intended. I didn''t know about that. Thanks!All that enter does is to hit the button by the keyboard instead of the mouse, so that does not explain it. Have you got the pdf of the book, if so then copy out the view and post it here. Or is the code downloadable from somewhere so that you can get it and post it? There is definitely a form on the page I presume? Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2010-Apr-03 16:41 UTC
Re: Re: Is it possible to have a form without a submit tag in rails?
On Sat, Apr 3, 2010 at 9:09 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>>> Browser dependent, but usually if you hit ENTER while in a text field >>> it will submit the form.> All that enter does is to hit the button by the keyboard instead of > the mouse, so that does not explain it.Sure it does. Open up a test app and put this minimal form in a page: <form action="/"><input/><input/></form> Load the page, put focus on one of those fields and hit the enter key. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Apr-03 19:14 UTC
Re: Re: Is it possible to have a form without a submit tag in rails?
On 3 April 2010 17:41, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sat, Apr 3, 2010 at 9:09 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >>>> Browser dependent, but usually if you hit ENTER while in a text field >>>> it will submit the form. > >> All that enter does is to hit the button by the keyboard instead of >> the mouse, so that does not explain it. > > Sure it does. Open up a test app and put this minimal form in a page: > > <form action="/"><input/><input/></form> > > Load the page, put focus on one of those fields and hit the enter key.I tried it, nothing happens. (in FF) Colin>> -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2010-Apr-03 19:20 UTC
Re: Re: Is it possible to have a form without a submit tag in rails?
On Sat, Apr 3, 2010 at 12:14 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>> <form action="/"><input/><input/></form> >> >> Load the page, put focus on one of those fields and hit the enter key. > > I tried it, nothing happens. (in FF)Proving it *is* implementation-dependent -- the form submits in both Safari and Chrome (on OS X, at least). -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Apr-03 19:45 UTC
Re: Re: Is it possible to have a form without a submit tag in rails?
On 3 April 2010 20:20, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sat, Apr 3, 2010 at 12:14 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >>> <form action="/"><input/><input/></form> >>> >>> Load the page, put focus on one of those fields and hit the enter key. >> >> I tried it, nothing happens. (in FF) > > Proving it *is* implementation-dependent -- the form submits in both > Safari and Chrome (on OS X, at least).So it is not likely that the tutorial the OP is following is assuming that this will work. Colin> > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Apr-05 13:26 UTC
Re: Re: Is it possible to have a form without a submit tag i
Colin Law wrote:> So it is not likely that the tutorial the OP is following is assuming > that this will work.As far as I can tell that is precisely what the the tutorial the OP is following is assuming. I also have a copy of that book and the example form is exactly as presented by the OP. Two text fields and one select field with no submit button. There is no mention of JavaScript. The example form is illustrated in Safari, which would function, but probably would not work in FF. So Yes, this is a bad example. The form should contain a submit button if you want it to work consistently in all browsers. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.