470,848 Members | 1,830 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Dynamic Printing of Values


Hi,

We have a combo box on our page, which gets populated via a MySQL
Query.

What we want to do is to print the values on the page in a table that
correspond the to selection from the combo box without a page refresh.

I assume that I'll need to query ALL the needed values from the
database and store them in an array. Drawing the combo box is not a
problem. But, once a selection is made, how do I print the values to
the page?

I'm assuming an 'on change' events needs to be attached to the box,
but, it is not a form, so, there would not be any submit to the
server. How do we print the values from the selection made? Would it
have to be javascript rather than PHP.

If yes, I'll go post there.....

John.
Jun 2 '08 #1
2 1106
On May 5, 10:42 am, Mtek <m...@mtekusa.comwrote:
Hi,

We have a combo box on our page, which gets populated via a MySQL
Query.

What we want to do is to print the values on the page in a table that
correspond the to selection from the combo box without a page refresh.

I assume that I'll need to query ALL the needed values from the
database and store them in an array. Drawing the combo box is not a
problem. But, once a selection is made, how do I print the values to
the page?

I'm assuming an 'on change' events needs to be attached to the box,
but, it is not a form, so, there would not be any submit to the
server. How do we print the values from the selection made? Would it
have to be javascript rather than PHP.

If yes, I'll go post there.....

John.
Yes -- ask a Javascript newsgroup.
Jun 2 '08 #2
Mtek a écrit :
I'm assuming an 'on change' events needs to be attached to the box,
but, it is not a form, so, there would not be any submit to the
server. How do we print the values from the selection made? Would it
have to be javascript rather than PHP.
You're completely right, so this is not the right newsgroup.

Still:
- onchange triggers on any change, no need for a submit button. You just
need to handle the default "null" value, since your first option cannot
be a value, else one would have to select an other value then come back
on the first to display the info.
- selectedIndex is your (js) key for Google :)

If you can't make your way with this, well you know where to post to get
a detailed answer at least :)

Regards,
--
Guillaume
Jun 2 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Angelos Karantzalis | last post: by
1 post views Thread by Nathan Bloomfield | last post: by
14 posts views Thread by chai | last post: by
8 posts views Thread by Eyeawanda Pondicherry | last post: by
4 posts views Thread by John | last post: by
3 posts views Thread by C#_learner | last post: by
19 posts views Thread by arnuld | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.