Solved

CGI.pm filefield() don't have a default value

Posted on 2000-03-08
5
414 Views
Last Modified: 2013-12-25
I have tried already lots of things, and notably I have read
the CGI.pm directives in the Perl5 documentation (which is, by
the way, very good).
But no matter what I'm trying, there is no way to set a value for
a filefield() form element.

By the way, I'm working in Win32. Is this another microsoft problem?

My company is going to swicth soon to Linux, and I can't wait!
0
Comment
Question by:gaggio
  • 3
5 Comments
 
LVL 1

Author Comment

by:gaggio
ID: 2598706
Also, I'd like the "Browse" button (which open
the file dialog) to act as a submit button.
Does anybody know how to do that?
Thanks for your help!
0
 
LVL 1

Author Comment

by:gaggio
ID: 2598725
I should have also added that the problem seems
to be that the CGI library can't have access to
the "setvalue" function.
The -onChange=>"myfunction(this)" attribute does not work at all either in filefields
0
 
LVL 4

Expert Comment

by:binkzz
ID: 2599766
You should be able to do this in javascript; if in the perl you write the javascript on that page and specify it in the body onload tag, the value should automatically be inserted; ie:

<body bgcolor=#FFFFFF onload=setvalue();>


<script language=javascript>
  function setvalue()
  {
    document.forms[0].fileinputname.value = 'c:\winnt\test.txt';
  }
</script>



Tom
0
 
LVL 10

Accepted Solution

by:
makerp earned 20 total points
ID: 2600367
aint allowed im affriad

active state help for cgi.pm says

"The optional second parameter is the starting value for the field contents to be used as the default file name (-default).

For security reasons, browsers don't pay any attention to this field, and so the starting value will always be blank. Worse, the field loses its ``sticky'' behavior and forgets its previous contents. The starting value field is called for in the HTML specification, however, and possibly some browser will eventually provide support for it."

therefore that bit of javascript will be ignored by browser

 

0
 
LVL 1

Author Comment

by:gaggio
ID: 2600961
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now