Two Combos Boxs on one ASP Page

Two combos that are linked but the values are hard-codedThis code also shows how to progamatically clear then populate a combo box fromclient code.Here is the code..<!-- Author: Adrian Forbes --><%    if Request("cboPrimary") = "" then< ...

Contributed by
Rating: 3 stars3 stars3 stars3 stars3 stars / 7
January 28, 2000
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

Two combos that are linked but the values are hard-coded

This code also shows how to progamatically clear then populate a combo box fromclient code.

Here is the code..

<!-- Author: Adrian Forbes -->
<%
    if Request("cboPrimary") = "" then
        lPrimary = "1"
    else
        lPrimary = Request("cboPrimary")
    end if
%>
<form name=frmTest action="TwoCombo.asp" method=POST>
<p>
<select name=cboPrimary size=1 onChange="frmTest.submit();">
<option value="1"<%if lPrimary = "1" then Response.Write "SELECTED"%>>Numbers
<option value="2"<%if lPrimary = "2" then Response.Write "SELECTED"%>>Fruit
<option value="3"<%if lPrimary = "3" then Response.Write "SELECTED"%>>Animals
</select>
</p>
<p>
<select name=cboSecondary size=1">
<%    select case lPrimary
    case "1"%>
<option value="1">One
<option value="2">Two
<option value="3">Three
    <%case "2"%>
<option value="4">Apple
<option value="5">Orange
<option value="6">Pear
    <%case "3"%>
<option value="4">Dog
<option value="5">Cat
<option value="6">Bear
    <%end select
%>
</select>
</form>

blog comments powered by Disqus
ASP CODE ARTICLES

- ASP Forms
- ASP: The Beginning
- Getting Remote Files With ASP Continued
- Inbox and Outbox Manipulation in ASP
- Relational DropDownList Using VB.NET
- Ad Tracking URL Hits
- Use ViewState to display one record per page...
- Send Email using ASP.NET formatted in HTML
- ASP File Explorer
- ASP/XML Interview questions by Srivatsan Sri...
- Pressing RETURN won't submit the form
- This shows how you get the TEXT of a combo r...
- Group Data by Adrian Forbes
- Multiple checkbox select sample
- Multiple checkbox select with all values sam...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials