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

Advanced
-Collapse +Expand ASP Classic Store

Prestwood eMagazine

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

   ► KBWebsite Scri...ASP Classic   Print This     
  From the November 2014 Issue of Prestwood eMag
 
ASP Classic Yes/No Function
 
Posted 10 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

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 5

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

Posted 5 months ago

Comment 2 of 5

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 22 days ago

Comment 3 of 5

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 20 days ago

Comment 4 of 5

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 20 days ago

Latest Comment
Comment 5 of 5

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 19 days 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 = P123A1
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 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

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


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