Writing filename to textbox

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing filename to textbox

Tray Williams

Writing file name to asp:textbox or input type="text".
I have the following code:

 
<tr>
<td align="right">First:<asp:TextBox ID="txtFirstDoc" runat="server" Enabled="false"></asp:TextBox></td>
<td><Upload:InputFile ID="FirstDocFileUpload" runat="server" />
</td>
</tr>

What I want is when I select the file from the file select dialog, I want to populate the text box with the file name. Is this possible? Can I suppress the text that shows the filename now?

Thank you in advance.

 
Reply | Threaded
Open this post in threaded view
|

Re: Writing filename to textbox

Tray Williams
Guess I cannot put in code. The code did show an ASP:Textbox and a FileUpload control.
Reply | Threaded
Open this post in threaded view
|

Re: Writing filename to textbox

Dean Brettle
Administrator
I don't think your question is specific to NeatUpload.  I think if you can do what you want with a standard FileUpload or HtmlInputFile control it should work with NeatUpload's InputFile as well.  If I remember correctly, you need to use an onselectionchange javascript handler to populate the textbox and some CSS/javascript tricks to hide the filename in the file control.  You might also consider using NeatUpload's MultiFile control which has support for customizing the display of selected files as well as customizing the look of the control itself.  For details, see:
Customizing MultiFile's Handling of Queued Files and Customizing the MultiFile Button.

--Dean