Solved

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

Posted on 2009-05-13
5
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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