<input type="file" value="path/file.jpeg"> in Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ChollaPete

    <input type="file" value="path/file.jpeg"> in Firefox

    This code:

    <form action="process Scan.php" method="get">
    <p>
    <?php
    print "Scan name: <input type=\"file\" name=\"tScanFil eName\" value=
    \"{$scanFileNam e}\"><br>";
    addHiddenCarryo ns();
    ?>
    <input type="submit">
    </form>

    does not render with the value attribute's value as the default text.
    I.e., then the form renders, I want the string value of $scanFileName
    already in the input field as the default text. I'm using Firefox
    2.0.0.12, PHP 5.2.4 and Apache 1.3.33.

    Any ideas?

    Thanks,
    Mark
  • Michael Fesser

    #2
    Re: &lt;input type=&quot;file &quot; value=&quot;pat h/file.jpeg&quot; &gt; in Firefox

    ..oO(ChollaPete )
    >This code:
    >
    ><form action="process Scan.php" method="get">
    ><p>
    ><?php
    print "Scan name: <input type=\"file\" name=\"tScanFil eName\" value=
    >\"{$scanFileNa me}\"><br>";
    addHiddenCarryo ns();
    >?>
    <input type="submit">
    ></form>
    >
    >does not render with the value attribute's value as the default text.
    >I.e., then the form renders, I want the string value of $scanFileName
    >already in the input field as the default text. I'm using Firefox
    >2.0.0.12, PHP 5.2.4 and Apache 1.3.33.
    >
    >Any ideas?
    The 'file' input control does not allow default values for security
    reasons. This would make it too easy to steal files from the user's
    machine.

    And BTW: HTML also allows single quotes around attributes. This avoids
    the ugly escaping like above.

    Micha

    Comment

    Working...