Client-side update of changing values to be displayed.

M

martin

I needed a way to display calculated, multiple, changing values
(numerical sums) as users interacted with the page, and do this
without going back to the server to load the page again.

What I finally settled on was <input type=button...> without an
"onClick" attribute (because the purpose of the buttons was only
for displaying values).

It works fine except they look and act like buttons. No big deal,
but is there a better way?

-Martin
 
L

Lasse Reichstein Nielsen

I needed a way to display calculated, multiple, changing values
(numerical sums) as users interacted with the page, and do this
without going back to the server to load the page again.

So you used client side scripting.
What I finally settled on was <input type=button...> without an
"onClick" attribute (because the purpose of the buttons was only
for displaying values).

A button *without* an "onclick" attribute (or at least an onclick
property set by a script) won't do anything. Are you sure you don't
mean *with* an onclick attribute?
It works fine except they look and act like buttons. No big deal,
but is there a better way?

You want something that the user can press to achieve an effect.
I can't see what would be more appropriate than a button.

/L
 
M

martin

Lasse Reichstein Nielsen said:
So you used client side scripting.


A button *without* an "onclick" attribute (or at least an onclick
property set by a script) won't do anything. Are you sure you don't
mean *with* an onclick attribute?


You want something that the user can press to achieve an effect.
I can't see what would be more appropriate than a button.

/L

The need was for someplace/someway to display javascript calculated
values without going back to the server. Like I said, the purpose
of the buttons is only for displaying a value. The displayed values
change, based on the user doing stuff in multiple places elsewhere.
It works fine, but looks a little weird. I suppose a Java applet is
indicated.

-Martin
 
A

Alex Fitzpatrick

martin said:
The need was for someplace/someway to display javascript calculated
values without going back to the server. Like I said, the purpose
of the buttons is only for displaying a value. The displayed values
change, based on the user doing stuff in multiple places elsewhere.
It works fine, but looks a little weird. I suppose a Java applet is
indicated.

-Martin

<INPUT type='text'> ???

Or did I eat a little too much stuffing?
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen
in news:comp.lang.javascript said:
I needed a way to display calculated, multiple, changing values
(numerical sums) as users interacted with the page, and do this
without going back to the server to load the page again.

What I finally settled on was <input type=button...> without an
"onClick" attribute (because the purpose of the buttons was only
for displaying values).

It works fine except they look and act like buttons. No big deal,
but is there a better way?

<input type=text name= ... readonly> to show it in a control; or use a
<textarea ...> ... </textarea>; or FAQ 4.15 to show it as ordinary HTML.

Read the FAQ.
 
M

martin

Dr John Stockton said:
JRS: In article <[email protected]>, seen


<input type=text name= ... readonly> to show it in a control; or use a
<textarea ...> ... </textarea>; or FAQ 4.15 to show it as ordinary HTML.

Read the FAQ.

Good thought, except "readonly" wouldn't allow for the values to
to be changed on the client-side as the script responds to events.
The need is to display changing values based on user interaction.
I guess I'm stuck with type=button.

But, this blows me away: I couldn't even get <input type=text
readonly...> to work anyway, and grasping at a last straw I tried
<input type=readonly ...> and guess what, it worked. Browsers
ignore HTML that they don't know about, but there they were,
little readonly text areas. The docs say nothing about this that
I can find. I can't change their values though, so I'm still
stuck with do-nothing buttons to display values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top