By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,458 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,458 IT Pros & Developers. It's quick & easy.

Client-side update of changing values to be displayed.

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
mc*******@earthlink.net (martin) writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Lasse Reichstein Nielsen <lr*@hotpop.com> wrote in message news:<k7**********@hotpop.com>...
mc*******@earthlink.net (martin) writes:
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


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
Jul 20 '05 #3

P: n/a
martin wrote:
Lasse Reichstein Nielsen <lr*@hotpop.com> wrote in message news:<k7**********@hotpop.com>...
mc*******@earthlink.net (martin) writes:

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

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?

--
Alex
Jul 20 '05 #4

P: n/a
JRS: In article <a7**************************@posting.google.com >, seen
in news:comp.lang.javascript, martin <mc*******@earthlink.net> posted at
Sun, 4 Jan 2004 09:54:11 :-
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.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #5

P: n/a
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in message news:<jg**************@merlyn.demon.co.uk>...
JRS: In article <a7**************************@posting.google.com >, seen
in news:comp.lang.javascript, martin <mc*******@earthlink.net> posted at
Sun, 4 Jan 2004 09:54:11 :-
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.


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.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.