View Full Version : Form question
03-23-2005, 12:44 PM
i want to reset a single field in a form. a file field to be specific.
i cant seem to get it to work :(
document.formname.formfield.reset(); doesnt work
i've looked around and tried other options too, but none of 'em seem to work..
help me plz ?? :)
03-23-2005, 01:17 PM
apologies - didn't mean to respond to this posting
03-23-2005, 02:07 PM
03-23-2005, 02:23 PM
that doesn't work.
it only works on text fields.
03-23-2005, 02:40 PM
What are you trying to reset then?
03-23-2005, 02:43 PM
i'm trying to reset a file field in a form.
one with a browse button next to it.
03-23-2005, 02:44 PM
If it is a textbox then this code will work, do you have code that I can look at?
03-23-2005, 03:23 PM
Input type=file is read only and for security reasons you can not manipulate it... the only way to reset that field without resetting the entire form is to remove and replace it with another simularly named field...
// Written By: WillyDuitt@hotmail.com || 03-23-2005 \\;
var input = document.createElement('input');
input.type = file.type;
input.name = file.name;
<form action="http://google.com" method="get">
<input type="file" name="file">
<input type="text" name="text">
<input type="button" value="Reset" onclick="reset_(this.form['file'])">
03-24-2005, 08:10 AM
that one works !
thanks for the help guys. appreciate it.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.