keeping value of file input field if an error

Joined
12 Feb 2006
Posts
17,677
Location
Surrey
currently i have a form which checks errors such as no name first, then if none it'll deal with the file uploading.

one downside (though perhaps it's not related to how i'd done the checking) is if there is an error with the form, the input field for the uploading of the file goes blank and needs to be selected again. is it possible to have it so this is filled in automatically even if there is an error?
 
i'm using php. i prefer to get it working perfectly without jquery and then add jquery to improve so not an option yet.

why can't i fill out the field by setting the value as $_POST['uploadedfilelocation']?
 
ok this is odd then as nothing is working.

this is what i have with small changes for this forum...

Code:
<input type='file' name='cv' id='cv' class='wide' value='<?= $cv; ?>'/>

if i change value to anything, e.g. $_POST['cv'], or "123ssdfoi" nothing is being shown, and also echoing $_POST['cv'] at start of file gives nothing.
 
Back
Top Bottom