I have a javascript (or Ajax) problem in some asp.net stuff I'm developing but wonder if anyone can advise
Iv'e got a form for uploading files in which the user can enter a title and select a file (sometimes they want a more meaningful name than the filename). In asp.net this is
<form ...>
<asp:textbox id="txtTitle" runat="server"></asp:textbox>
<input id="myFile" type="file" name="myFile" runat="server"/>
</form>
which interpretes in standard html as:
<form action="" ...>
<input type="txtTitle" name="title">
<input type="file" name="myFile">
<button id="submit" ..>
</form>
The myFile shows a browse button which allows you to go select a file (pretty straightforward so far) before pressing submit
What I'd like to do though is if the user uses the browse button to select a file and hasn't put in a title in the title field then the filename is put in the title field.
Obviously its easy to do this when you submit, but I'd like to do it dynamically when the user has selected a file, giving the user the choice of editing the text before submitting but saving them having to type in the whole filename. Is there anyway of doing this - either in Ajax or javascript?
Thanks
AndyH1
Iv'e got a form for uploading files in which the user can enter a title and select a file (sometimes they want a more meaningful name than the filename). In asp.net this is
<form ...>
<asp:textbox id="txtTitle" runat="server"></asp:textbox>
<input id="myFile" type="file" name="myFile" runat="server"/>
</form>
which interpretes in standard html as:
<form action="" ...>
<input type="txtTitle" name="title">
<input type="file" name="myFile">
<button id="submit" ..>
</form>
The myFile shows a browse button which allows you to go select a file (pretty straightforward so far) before pressing submit
What I'd like to do though is if the user uses the browse button to select a file and hasn't put in a title in the title field then the filename is put in the title field.
Obviously its easy to do this when you submit, but I'd like to do it dynamically when the user has selected a file, giving the user the choice of editing the text before submitting but saving them having to type in the whole filename. Is there anyway of doing this - either in Ajax or javascript?
Thanks
AndyH1