Hi there,
farily simple question, I want to be able to use a piece of artwork for the browse button used in the filefield section of the following script, instead of using the default "Browse..."
Something like the submit button, but I don't know how to implement this for the filefield part. Any help is much appreciated, an example would be great.
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser); #errors will show in the browser
my $newStyle;
my $co=new CGI;
print $co->header,
$co->start_html(
-title=>'fileupload.cgi',
-BGCOLOR=>'#FFFFFF',
-style=>{-src=>'http://localhost/html/stylesheet.css',
-code=>$newStyle}
),
$co->start_multipart_form(
-method=>'POST',
-action=>"fileupload2.cgi",
-enctype=>"multipart/form-data",
),
$co->p,
$co->filefield( -name => 'file',
-default => "starting value",
-size => 30,
-maxlength => 80,
),
http://localhost/html/add.bmp",
-value => "starting value",
),
$co->p,
$co->image_button( -name => "submit",
-src => "http://localhost/html/add.bmp",
),
$co->end_multipart_form;
$co->end_html;
exit 0;
Thanks in advance,
Jonathan
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.