[PLUG-TALK] XHTML-1.0 Strict Form Tags Reference
Alex LeDonne
aledonne.listmail at gmail.com
Mon Aug 27 21:44:27 UTC 2007
On 8/27/07, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> Alex,
>
> I mis-understood the target tag when I first read about it.
>
> Since my web pages over the past 9 years have been static and required no
> input from viewers, this is all a new experience for me. Perhaps I do need
> javascript. I need to learn what I need to learn to accomplish the task of
> collecting three input variables and displaying the returned result. The use
> of the python cgi library is another issue.
>
> Thanks,
>
> Rich
OK, cool.
There are two basic ways to do what you describe.
1/ Old-fashioned CGI form - when the button is pushed to submit, the
script on the server sends back the whole form, but with the fields
filled in with the existing values and with a result filled in
wherever you like. Tried and true, works with any browser, even with
javascript turned off for the moderately paranoid. Often implemented
as a backup for option 2 below.
2/ New-fangled Web2.0 AJAX form - when the button is pushed to submit,
a javascript function makes an HTTP request to a script (CGI, web
service, etc) which supplies just the results; that function then
updates a <div/> on the page with the HTML fragment (possibly
processed further) it received from the request. The canonical,
don't-reinvent-the-wheel method for doing so is the scriptaculous.js
library http://script.aculo.us/ (which in turn requires prototype.js,
http://prototypejs.org/). The scriptaculous site includes some docs
and tutorials to get the ball rolling.
I'm assuming that you're either retrieving values from a remote
resource, or you want to keep your algorithm under wraps, so that
client-side javascript implementation is not an option.
Does this set you on the path to learn what you need to learn? :)
-Alex
More information about the PLUG-talk
mailing list