Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Display region if value exists and is 13 characters long.

I am using ASP Classic / VB Script . I need to add some code to display a region IF the value of a recordset field is 13 characters long.

This is inside a repeated region (I am using DW CC 2014.1)

Display the following code:

---

<div align="center"><span class="bodytext"><a href="javascript:;" class="bodytextreports" onClick="GP_AdvOpenWindow('../../../USCIS.asp?ReceiptNum=<%=(Receipts.Fields.Item("rcptno").Value)%>','USCIS','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,channelmode=no,directories=no',800,600,'center','ignoreLink','',0,'',0,1,5,'');return document.MM_returnValue">Tracking</a><br>
                          </span></div>

---

if the value in   %=(Receipts.Fields.Item("RcptNo").Value)%>  is NOT null or '' and its 13 characters long
Avatar of Big Monty
Big Monty
Flag of United States of America image

something like this should do the trick:

<%
rcptNo = Receipts.Fields.Item("RcptNo").Value
if rcptNo <> "" and Len( rcptNo ) = 13 then
%>
<div align="center"><span class="bodytext"><a href="javascript:;" class="bodytextreports" onClick="GP_AdvOpenWindow('../../../USCIS.asp?ReceiptNum=<%=(Receipts.Fields.Item("rcptno").Value)%>','USCIS','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,channelmode=no,directories=no',800,600,'center','ignoreLink','',0,'',0,1,5,'');return document.MM_returnValue">Tracking</a><br>
                          </span></div>
<%end if %>

Open in new window

Avatar of Aleks

ASKER

Sweet ! thanks !
Avatar of Aleks

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for amucinobluedot's comment #a40802567

for the following reason:

Great !
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

Sorry .. lol
Avatar of Aleks

ASKER

:)