I''m creating a very simple Rails application where I enter "First number" and then "Second number" and get the result in the "Sum". Those are some files: show.html.erb: http://pastie.org/private/1cydign77xnijlrb7mjvng _form.html.erb: http://pastie.org/private/narsz5oeuafahclqtvmwq What do I want? I just want the Sum to be DISPLAY the summation result automatically after entering the first and second numbers, without having a text box beside some. I think it may be a HRML/CSS touch? What should I do here? 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.
Abder-Rahman Ali wrote:> I''m creating a very simple Rails application where I enter "First > number" and then "Second number" and get the result in the "Sum". > > Those are some files: > > show.html.erb: http://pastie.org/private/1cydign77xnijlrb7mjvng > _form.html.erb: http://pastie.org/private/narsz5oeuafahclqtvmwq > > What do I want? > > I just want the Sum to be DISPLAY the summation result automatically > after entering the first and second numbers, without having a text box > beside some. > > I think it may be a HRML/CSS touch? > > What should I do here? > > Thanks.If you want to populate the sum field with the result of first number + second number, consider JavaScript. -- 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.
Thanks Pale, cannot I use CSS for that. I''m actually not aware of Javascript. -- 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.
Abder-Rahman Ali wrote:> Thanks Pale, cannot I use CSS for that. I''m actually not aware of > Javascript.Do no not use CSS for this; CSS is for styling your page. If you''re not familiar with JavaScript, can I suggest you start here: http://w3schools.com/js/default.asp -- 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.
Pale Horse wrote:> Abder-Rahman Ali wrote: >> Thanks Pale, cannot I use CSS for that. I''m actually not aware of >> Javascript. > > Do no not use CSS for this; CSS is for styling your page. If you''re not > familiar with JavaScript, can I suggest you start here: > http://w3schools.com/js/default.aspGot you Pale. So, you mean that even I have the result, I cannot display it using CSS since it is for styling? I''ll check Javascript then. Thanks a lot. -- 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.
Abder-Rahman Ali wrote:> Pale Horse wrote: >> Abder-Rahman Ali wrote: >>> Thanks Pale, cannot I use CSS for that. I''m actually not aware of >>> Javascript. >> >> Do no not use CSS for this; CSS is for styling your page. If you''re not >> familiar with JavaScript, can I suggest you start here: >> http://w3schools.com/js/default.asp > > Got you Pale. > > So, you mean that even I have the result, I cannot display it using CSS > since it is for styling?Right. Basically, if you want dynamic behavior on the client side, you need JavaScript. Remember to provide an alternative for those without JavaScript! (Look up "progressive enhancement" for a good way to do this.)> > I''ll check Javascript then. >Your first stop should be Doug Crockford''s website ( http://www.crockford.com ). In particular, note and follow his recommendation to put JavaScript in separate files rather than mixing it in with HTML. If you want a book, I recommend David Flanagan''s JavaScript: The Definitive Guide; Doug Crockford''s JavaScript: The Good Parts seems good also. http://www.javascriptkit.com is a good basic language reference.> Thanks a lot.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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.
Thanks a lot Marnen for your nice recommendations and advice. -- 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.