[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP/VB Syntax

Posted on 2014-08-20
4
Medium Priority
?
337 Views
Last Modified: 2014-08-20
I have the code below which is giving me a syntax error, should be simple ... I hope.

           <% ' If field is checked off
If (Qnrpg1.Fields.Item("email").Value = "False")Then
input name="email" type="hidden" id="email" value="(ContactDetails.Fields.Item("Email").Value)"
<% End If %>  

It should check for the value of a field, if its "False" then should create that hidden field. This is the error:
0
Comment
Question by:Aleks
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Big Monty
ID: 40273232
is email a string value or a boolean? if it's a boolean value, then you would want:

 <% ' If field is checked off
If (Qnrpg1.Fields.Item("email").Value = False )Then %>
input name="email" type="hidden" id="email" value="(ContactDetails.Fields.Item("Email").Value)"
<% End If %>  

Open in new window


if it's a string value, then you have it correct, you're just missing your closing %> tag:

 <% ' If field is checked off
If (Qnrpg1.Fields.Item("email").Value = "False")Then %>
input name="email" type="hidden" id="email" value="(ContactDetails.Fields.Item("Email").Value)"
<% End If %>  

Open in new window

0
 
LVL 34

Expert Comment

by:Big Monty
ID: 40273234
if this isn't working, please post the error as it was absent from your first post
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40273238
Guessing this is what you want.

<%' If field is checked off
If Qnrpg1.Fields.Item("email").Value = "False" Then%>
	<input name="email" type="hidden" id="email" value="<%=ContactDetails.Fields.Item("Email").Value%>">
<% End If %>

Open in new window

0
 

Author Closing Comment

by:Aleks
ID: 40273264
The first two solutions gave me an error still, the third one worked fine. Ill try that one thanks !
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question