form field values

L

led

I need to display the values of the search criteria submited in a form.
But when the search is "all values" i need to change "%" or "1 or 1" if its
a numeric field by displaying "all values"

code:
Pesquisou por<b><font color="#FF0000"><i>&nbsp; <%=request("tipo")%>'s </i>
</font></b>, Lotação<b><font color="#FF0000"><i>
<%=request("pessoas")%>&nbsp;&nbsp;
</i></font></b>pessoas, em<b><font color="#FF0000"><i>
<%=request("localidade")%>&nbsp;&nbsp;
</i></font></b>,Durante<b> <span style="font-weight: 400">mês</span><font
color="#FF0000"><i> &nbsp; <%=request("nm_mes")%>
 
D

David Berry

What's the rest of the code? Is this the results page or the search page?
Can you post both?

Do you mean the % as in a percentage? Why not just use FormatPercent? You
can use a function to see if it's a number or a percent and then display it
or display a blank if it's not. Or change the function to display a 1 if
that's what you're looking for. Ex:

<%
function PercentOrNull(num,x)
if isnumeric(num) = false or isnull(num) or num=0 then
num = vbnullstring ' or change it to a 1
else
num = formatpercent(num,x)
end if
PercentOrNull = num
end function
%>

<%= PercentOrNull(request("localidade"),2 )%>

You could also use an IF ... Then ... END IF to do this
 

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