Solved

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

Posted on 2009-05-13
5
223 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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