Solved

Can you pass the label value of a list/menu field on a form?

Posted on 2009-05-13
5
218 Views
Last Modified: 2012-05-06
I have an insert record form linked to an ODBC Access database. The Candidate field is a dynamic list/menu (drop-down box). The list/menu displays the Candidate Name (CandName)and the value stored is the Candidate foreign key. I would like to refer to the Candidate name in an email script upon submitting the form. Is there a way to capture the label value of the list/menu box so I can use the Candidate Name, either as a hdiden value or not?
<select name="staffcandidate" size="1" id="staffcandidate">

      <option value="0">Select One</option>

      <%

While (NOT Candidates.EOF)

%>

      <option value="<%=(Candidates.Fields.Item("CandidateID").Value)%>"><%=(Candidates.Fields.Item("CandidateChoice").Value)%></option>

      <%

  Candidates.MoveNext()

Wend

If (Candidates.CursorType > 0) Then

  Candidates.MoveFirst

Else

  Candidates.Requery

End If

%>

    </select>

Open in new window

0
Comment
Question by:mikebollinger
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
neeraj523 earned 500 total points
ID: 24382578
Hello

I dont think there is any simple way to handle this situation.. but you can try something like this..

=================================================
<select name="staffcandidate" size="1" id="staffcandidate">
      <option value="0">Select One</option>
      <%
While (NOT Candidates.EOF)
%>
      <option value="<%=(Candidates.Fields.Item("CandidateID").Value)%>;Candidates.Fields.Item("CandidateChoice").Value"><%=(Candidates.Fields.Item("CandidateChoice").Value)%></option>
      <%
  Candidates.MoveNext()
Wend
If (Candidates.CursorType > 0) Then
  Candidates.MoveFirst
Else
  Candidates.Requery
End If
%>
    </select>
=================================================

and then onsubmit, you can read values like this

==================================================
CandArr = Split(Request("staffcandidate"), ";")
Response.Write "Id: " & CandArr(0) & "<BR>"
Response.Write "Name: " & CandArr(1)

===================================================
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 24742311
Hello Jason

I appreciate your initiative for cleanup but wondering on the reccomendation you posted for this question. Does this means the efforts, experts are putting to answer the question are useless? Dont see the reason why my solution has been just ignored without any evaluation.

This is very discouraging act from a EE volunteer. I want to raise a question on this from Jason and EE elite panel.

Regards
Neeraj
0
 

Author Closing Comment

by:mikebollinger
ID: 31581291
My apologies for not replying to this sooner. You were very prompt in replying to my request as well.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now