Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box values to be prepopulated

Status
Not open for further replies.

arravalli12

Programmer
May 3, 2005
62
0
0
US
I had created application and was working fine.This application has two textboxes. One for file description and other for file name. Now the user is making mistakes in naming the file. He/She is supposed to keep the same name as File description but name will not have any spaces.
Now I have been asked to rewrite this application in such a way that file name should be populated with file description without any spaces. And for file extension, will create a list box that she needs to select. User should be not allowed to do anything with file name.
I was just wondering how to populate before submitting form. Any ideas or suggestions will be appreciated.


Thanks
 
In the ASP that processes this HTML form, you can use the Replace() function to replace spaces with empty strings.

For the file extensions you can go with plain HTML unless you need to pull the extensions themselves from a DB or calculate them or something...

The plain HTML might look something like this:[tt]
<select name='Extens'>
<option value='.txt'>Text File</option>
<option value='.csv'>Comma Separated Values</option>
<option value='.xls'>MS Excel</option>
</select>
[/tt]
 
Thanks for the reply.
I have used replace function and works fine.

fName =trim(Request.form("txtDesc"))
fName =replace(fName," ","")


Also used in html
<select name="ext">
<option value=".doc"<% if (request.form("ext")) = ".doc" then %> Selected<% end if %>>document file(.doc)</option>
<option value=".txt"<% if (request.form("ext")) = ".txt" then %> Selected<% end if %>>text file(.txt)</option>
<option value=".pdf"<% if (request.form("ext")) = ".pdf" then %> Selected<% end if %>>pdf file(.pdf)</option>
<option value=".xls"<% if (request.form("ext")) = ".xls" then %> Selected<% end if %>>Excel Spreadsheet(.xls)</option>
<option value=".zip"<% if (request.form("ext")) = ".zip" then %> Selected<% end if %>>zip file(.zip)</option>
</select></td>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top