in reply to Need buttons on web page for retrieving database values
You'll have to use normal form submit buttons for this.
Javascript buttons that have functions responding to
onClick events can execute client-side code only, and can't
talk to your database.. a full-fledged submit must be done.
If you need 12 different buttons, you'll either need to
(as mentioned above) name the submit buttons, or use 12
different forms on your page. I would choose the latter of
those two choices, as it would let you break up the code
into more managable chunks, rather than one huge block of
code which must be re-parsed on every submit and use a bunch
of if/elsif statements. This also, of course, depends on
if, and how much, of the same code will be executed
depending on which button is pressed.
RE: Re: Need buttons on web page for retrieving database values
by btrott (Parson) on Mar 28, 2000 at 06:44 UTC
|
Just as an aside--the reason I suggested the former is
because, for my own purposes, I've wanted to display a
row of buttons; and if I put these into separate forms,
browsers generally seem to insert paragraph breaks between
the forms, which thwarts any attempt at horizontal
alignment. That's more of an HTML issue, of course.
In general, I'd agree w/ you about separating different
pieces of functionality; though a general approach I've
been taking recently is to have one main script which
contains some dispatch code--upon receiving a new request,
it determines the nature of the request, then hands it off
to the appropriate handler, where each handler is generally
stored in its own module. | [reply] |
|
| [reply] |
|