PDA

View Full Version : browse file field options


deafboyzaudio
09-28-2009, 07:22 PM
I have this code for a "browse for file" option for uploads:
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input name="Browse5" type="file" id="browse" size="45" maxlength="200" />
<input name="Browse4" type="file" id="browse" size="45" maxlength="200" />
<input name="Browse3" type="file" id="browse" size="45" maxlength="200" />
<input name="Browse2" type="file" id="browse" size="45" maxlength="200" />
<input name="Browse" type="file" id="browse" size="45" maxlength="200" />
<input name="Submit" type="submit" id="submit" value="Upload" /></form> right now you can click in the text field but not type anything and the delete key deletes everything in IE
In firefox clicking the file field brings up the browse box.
Basically i want only the browse button to bring up the browse box and to be able to edit the filename in the text field
whats the best way to do this?

edbr
09-29-2009, 01:10 AM
you mean you want to rename the file that is uploaded? if so that is best done in the upload script, if you have a text field the script could be adapted to take the new name from that field

deafboyzaudio
09-29-2009, 01:24 AM
I have renaming conventions already in place in my script. i actually want user to be able to type in the text field.
The main reason i want this is because if someone decides they don't want to upload a pic anymore, then they can just delete the filename in the text field. They can also type one in long hand if they choose.
as it is now, anytime you click the field, you are brought up a browse box and are forced to choose something (in FF at least)

edbr
09-29-2009, 02:47 AM
then as i said you need a text field for naming, you cant type in a file field

deafboyzaudio
09-30-2009, 04:46 PM
ok i had a feeling thats what i needed but i couldnt get it to work so i wasnt sure. How do i get the button action to open up a browse box and whatever the user selects, transfer into the text field?

edbr
10-01-2009, 01:10 AM
im not sure i get what you mean. the file field will have a browse button a text field can be typed in. the script can then be written to rename the fle to what name you type in the text field. Is that not what you want

deafboyzaudio
10-01-2009, 02:35 PM
i want a text field but i want a browse button next to it. the browse button functions like it would normally. the only difference will be that the file field is actually a text field. i just am not quite sure how to do this.

Im not worried about editing the name in the sense of renaming. i just want users to be able to delete the whole field if they want to choose not to upload the file.

i can get the text field, i just cant get the button to function as a browse button.