Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: beautiful form(s) with CGI

by Anonymous Monk
on Jan 13, 2015 at 13:08 UTC ( [id://1113082]=note: print w/replies, xml ) Need Help??


in reply to beautiful form(s) with CGI

Yes it is, although CGI isn't directly involved since it's mostly done on the client side with a combination of CSS and JavaScript.

So for example, a quick look at the source of perlcritic.com shows that it primarily uses Bootstrap, see http://getbootstrap.com/. There are nowadays a whole bunch of CSS frameworks available, and several JavaScript libraries, such as jQuery (http://jquery.com/).

There are a couple of Perl web frameworks that are "more modern" than CGI which you might want to look at, see for example Mojolicious or Catalyst. But if you're using CGI, here's an example of how you might tie CSS & JavaScript libraries into your page, assuming you've downloaded http://necolas.github.com/normalize.css/3.0.2/normalize.css and http://code.jquery.com/jquery-1.11.2.min.js to your local directory:

print start_html -style => { -src => [ 'normalize.css', 'mystyle.css' ] }, -script => [ { -type=>"text/javascript", -src=>"jquery-1.11.2.min.js" }, q{ alert("I'm some embedded JavaScript"); } ];

You'll still need to read the documentation of whatever frameworks you decide to use to see how to access their functions, which is usually not a question of Perl but of CSS, HTML and JavaScript. CGI provides a -style argument for most of its HTML functions that can be used to specify CSS classes and other style elements.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113082]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-24 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found