If statement cutting off data

  • Thread starter Thread starter Targa
  • Start date Start date
T

Targa

Im using the following If statement to display a textbox containing the
company name if the client is listed as Commercial.

<% If rs("Client_Type") = "Commercial" then response.write
"<input type='textbox' name='Company' size='30' value=" & rs("CompanyName")
& "><BR>" End If %>

The problem is it cuts off the company name data if there is more than one
word in the name.

If the company name is "Some Company", this will display "Some"
but "<input type="textbox" value="<% = rs("CompanyName") %>"> displays fine
as "Some Company"

What am I doing wrong here?

Thanks!
 
Try:

<% If rs("Client_Type") = "Commercial" Then %>
<input type="text" name="Company" size="30" value="<%=rs("CompanyName")%>"><br>
<% End If %>


--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Worked - of course,

Thanks Thomas!





Thomas A. Rowe said:
Try:

<% If rs("Client_Type") = "Commercial" Then %>
<input type="text" name="Company" size="30"
 
You are welcome.

I always try to avoid using "Response.Write" statements, unless absolutely necessary.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top