Your full service technology partner! 
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

-Collapse +Expand ASP Classic Store

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite Scri...ASP Classic   Print This    All Groups  
  From the November 2014 Issue of Prestwood eMag
ASP Classic Yes/No Function
Posted 11 years ago on 6/15/2010
ASP Classic Code Snippet:
 A flashcard from our ASP Classic Flashcards Library
 A code snippet from our ASP Classic Code Snippets Page


The following function demonstrates one technique for coding a Yes/No dropdown. It uses a for loop which can be expanded to handle more than the 3 states (Y, N, and blank).

Example of calling the function:

Do you fish? <%=YesNoDropDown("ynFish", "")%>
Syntax Example:
Function YesNoDropDown(strName, strSelected) 
 Dim i
 Dim strSelectedString
 Dim YesNoName
 Dim YesNoCode
 YesNoName = Array("Yes","No")  
 YesNoCode = Array("Y","N")
 YesNoDropDown = "<select name='" & strName & "'>" & vbcrlf
 YesNoDropDown = YesNoDropDown & "<option>" & "--" & "</option>"
 For i = 0 To UBound(YesNoName)  
  If strSelected = YesNoCode(i) Then    
   strSelectedString = "Selected"  
   strSelectedString = ""  
  End If          
  YesNoDropDown = YesNoDropDown & "<option value='" & YesNoCode(i) & "' " & _      
  strSelectedString & " >" & YesNoName(i) & "</option>" & vbcrlf 
 YesNoDropDown = YesNoDropDown & "</select>" & vbcrlf 
End Function



Share a thought or comment...
First Comment
Comment 1 of 6

To opt-out now, use our Immediate Unsubscribe link.

Posted 18 months ago

Comment 2 of 6

No function with these classic is now need some changes. If they implement these changes on it in that way to show what they are taking from what they have. A real strong meaning with complete cheap essay writing service uk but it not show us any kind of function with these classic match.

Posted 14 months ago

Comment 3 of 6

We have achieved our objective of providing the premium quality of dissertation writing for our customers. We have made this possible through our professional dissertation writers who perform their duties commendably and use their knowledge in the best possible way that helps them to produce and maintain the premium quality of the dissertation. We believe in providing you with the on-time deliverance of your task. Our procedures of working are based on the writing principles. We assure you of the authenticity and reliability of the document.

Posted 14 months ago

Comment 4 of 6

We provide top-quality assignment help to students in UK, USA. Buy Online Homework Help and receive fast homework writing services from our expert assignment help at a cheap price. you can also get write my essay for me cheap services.

Posted 14 months ago

Comment 5 of 6

The introduction of your content is more important than you think. The thing that can impress your instructor and increase the interest in your content is your introduction. Research Paper Writing Services 

Posted 14 months ago

Latest Comment
Comment 6 of 6
We offer you to approach our online essay help service for premium quality results. Our team of expert writers are full of required skills and knowledge. They have achieved their higher academics in different fields that make a team of finest and versatile writers. Deep knowledge about the subject enables them to provide you services without any limitations. Our quality assurance department makes sure that the information used in the entire essay are 100% authentic, reliable and relevant to be delivered on-time.
Posted 13 months ago
Write a Comment...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1273A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #102169 Counter
Since 6/15/2010
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site:

©1995-2021 Prestwood IT Solutions.   [Security & Privacy]