• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Need ASP JS-equivalent for NULL form field

Hello.  I am using Classic ASP JS.  I need the JS-equivalent for the following ASP VBScript code:
--------------------------------------------------------------------------------------------
<% if (rsProdDetail.Fields.Item("ProdSize").Value) <> then %>
      <%=(rsProdDetail.Fields.Item("ProdSize").Value)%>
    <% end if %>
--------------------------------------------------------------------------------------------


The following is the error I get on the web:
--------------------------------------------------------------------------------------------
Microsoft JScript compilation error '800a03ea'
Syntax error
/product_details.asp, line 208
if (rsProdDetail.Fields.Item("ProdSize").Value) <> then
--------------------------------------------------------------------------------------------

The little "carrot" symbol was directly underneatht eh "<>", so that may be the problem, but I don't know the equivalent replacement.


Thanks so much,
Shane
0
lshane
Asked:
lshane
  • 3
  • 2
1 Solution
 
HappyFunBallCommented:
<% if not isnull(rsProdDetail.Fields.Item("ProdSize").Value) then %>
      <%=(rsProdDetail.Fields.Item("ProdSize").Value)%>
    <% end if %>

or just this:

<%
if not isnull(rsProdDetail.Fields.Item("ProdSize").Value) then
    Response.Write(rsProdDetail.Fields.Item("ProdSize").Value)
end if
%>

0
 
lshaneAuthor Commented:
Thanks for the reply, HappyFunBall.  I tried both suggestions, but I'm getting the same ( or a similar) error:

-------------------------------------------------------------------------------
Microsoft JScript compilation error '800a03ed'
Expected '('
/product_details.asp, line 208
if not isnull(rsProdDetail.Fields.Item("ProdSize").Value) then
-------------------------------------------------------------------------------

I tried inserting parentheses, etc., but it never seemed to satisfy the error.

Any thoughts?

Thanks,
Shane
0
 
HappyFunBallCommented:
I'm sorry, I misread the question.

You need the JS - equivalent.  I tried to fix the VB code (which appeared broken)

In JS, this is the equivalent:

<% if ((rsProdDetail.Fields.Item("ProdSize").Value) != null) then %>
      <%=(rsProdDetail.Fields.Item("ProdSize").Value)%>
    <% end if %>


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
lshaneAuthor Commented:
Not a problem.  However, I did try your JS suggestion, but still received the following error:
---------------------------------------------------------------
Microsoft JScript compilation error '800a03ec'
Expected ';'
/product_details.asp, line 210
end if
----^
---------------------------------------------------------------

Thanks for your continued assistance,
Shane
0
 
Ryan ChongCommented:
maybe this....


<% if ((rsProdDetail.Fields.Item("ProdSize").Value) != null) { %>
      <%=(rsProdDetail.Fields.Item("ProdSize").Value)%>
    <% } %>
0
 
lshaneAuthor Commented:
That was brilliant, ryancys.  Thank you.  I appreciate it.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now