#! /usr/bin/perl use strict ; use warnings ; use JQuery::Demo ; use CGI ; package main ; my $tester = new JQuery::Demo ; $tester->run ; package JQuery::Demo ; use JQuery::Taconite ; use JQuery::Form ; # This initiates the form # Note: the hidden field "rm" to tell the program which routine to use for the reply # The form is just a simple form, with the addition of an id # To use Taconite (Ajax), just add register Taconite with jquery, and add the id of the form sub start { my $my = shift ; my $q = new CGI ; $my->{info}{TITLE} = "Taconite With Form Example" ; my $jquery = $my->{jquery} ; JQuery::Form->new(id => 'myForm', addToJQuery => $jquery) ; my $html =< Name:
Comment:


This is the structure example div.
EOD $my->{info}{BODY} = "

START OF FORM EXAMPLE

$html

END OF EXAMPLE

" ; } # This updates the form sub reply { my $my = shift ; #my $params = $my->Vars; #my $par ; #for (sort keys %$params) { # $par .= "$_ = $params->{$_}
\n" ; # } my $env ; for (sort keys %ENV) { $env .= "$_ = $ENV{$_}
\n" ; } my $result=< $env This text will go AFTER the example div.
This div will go BEFORE the example div.
This div is APPENDED
 
        lorem ipsum dolor sit amet 
        consectetuer adipiscing elit 
        
EOD $my->{info}{AJAX} = $result ; #print $q->header(-type=>'text/xml'); #print $result ; }