Displaying the sum

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.

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.

Thanks Pale, cannot I use CSS for that. I'm actually not aware of Javascript.

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: JavaScript Tutorial

Got 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.

Thanks a lot Marnen for your nice recommendations and advice.