blank spaces in <%asp%> field

S

skc

I am using DRW to populate a text box. So in the text box
I am simply putting in <%=variable%> as the value. In my
DRW I am defining my hidden variable as: <%
variable=fp_fieldval(fp_rs,"fieldname")%>.

Trouble is...I am getting a blank space if there is no
value in the database or if the variable has no value. I
have used <%=Trim(variable)%> as the value of the text
box, but I am getting around two/three blank spaces.

How can I get rid of this???

Thanks,

skc
 
T

Thomas A. Rowe

Try

<% If fp_rs("fieldname") > " " Then %>
<%=fp_rs("fieldname")%>
<% End If %>

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

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

skc

Thomas,

Why the ">" - surely you mean "<>"?

Skc
-----Original Message-----
Try

<% If fp_rs("fieldname") > " " Then %>
<%=fp_rs("fieldname")%>
<% End If %>

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

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp




.
 
T

Thomas A. Rowe

Skc,

Which one to use depending on what is stored in the table field and/or what you want to test for.
" " greater than a space
"" greater than null
<> "" not equal to null
<> " " not equal to a space

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

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

skc

Thomas,

I have tried everything - but I cannot get rid of the
space!!!

Is there a way of doing an onclick event that
automatically gets rid of leading spaces?

skc
-----Original Message-----
Skc,

Which one to use depending on what is stored in the table
field and/or what you want to test for.
 
T

Thomas A. Rowe

If you have leading or trailing spaces, do the following

<%=Trim(fp_rs("fieldname"))%>

--
==============================================
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

Top