Solved

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

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

15 Experts available now in Live!

Get 1:1 Help Now