faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Common Problems : forms and user input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 6 people (50%) answered Yes
Recently 3 of 6 people (50%) answered Yes

Entry

How can I replace all spaces with 1 comma in a textarea in asp?

Mar 23rd, 2004 00:23
Jason Benson, diana,


After your form submits you can get the field data depending on the 
method of the form.

Example:
The user inserts "Wow nifty text field!" into a field called "MyText"

if your field is named "myfield" and you are using the POST method:
<%
Response.Write Replace(Request.Form("MyText"), " ", ",")
%>

if your field is named "myfield" and you are using the GET method:
<%
Response.Write Replace(Request.QueryString("MyText"), " ", ",")
%>

Either will output "Wow,nifty,text,field!"

If you want to parse the text before submitting then you will need to 
interact with the form using client side javascript.

hope that helps
jb



© 1999-2004 Synop Pty Ltd