HTML::DragAndDrop - Basic DIV

Home » Tutorials » HTML::DragAndDrop talk
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

use HTML::DragAndDrop;

my $q = new CGI;

my $dd = HTML::DragAndDrop->new(
  javascript_dir => '/javascript/',
);

print $q->header;
print $q->start_html(
  -title => 'HTML::DragAndDrop',
  -style => {-src => '/style/draganddrop.css'},
);

print $q->h2("HTML::DragAndDrop");
print q(<div id="next"><a href="/cgi-bin/draganddrop/example03.pl">Next</a></div>);


$dd->add_dragable(
 name    => 'dragable1',
 content => q(
   Some HTML
   <form>
   <input type="text" name="afield" value="Some data" />
   <input type="button" value="Go" onclick="Javascript:alert('Go');" />
   </form>
 ),
);


print $dd->output_html;
print $dd->output_script;

print $q->end_html;
Some HTML