[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

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

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
mikebollinger
Asked:
mikebollinger
  • 2
1 Solution
 
neeraj523Commented:
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
 
neeraj523Commented:
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
 
mikebollingerAuthor Commented:
My apologies for not replying to this sooner. You were very prompt in replying to my request as well.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now