?
Solved

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

Posted on 2000-03-08
5
Medium Priority
?
433 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 60 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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…
Suggested Courses

765 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