From the November 2014 Issue of Prestwood eMag
 
ASP Classic Yes/No Function
 
Posted 6/15/2010 on 6/15/2010
ASP Classic Code Snippet:

KB102169

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"  
  Else    
   strSelectedString = ""  
  End If          
  
  YesNoDropDown = YesNoDropDown & "<option value='" & YesNoCode(i) & "' " & _      
  strSelectedString & " >" & YesNoName(i) & "</option>" & vbcrlf 
 Next      
 
 YesNoDropDown = YesNoDropDown & "</select>" & vbcrlf 
End Function

 

Comments

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

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

Posted 1/20/2020

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 5/11/2020

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 5/13/2020

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 5/13/2020

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 5/14/2020

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 6/29/2020
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 play-drums.com 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
www.prestwood.com For service: 916-726-5675
or support@prestwood.com
Copyright (C) Prestwood IT Solutions.
All Rights Reserved.
Printed 7/14/2020