Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning A Value To A Variable Inside A Function 1

Status
Not open for further replies.

FontanaS

Programmer
Joined
May 1, 2001
Messages
357
Location
US
Hi!

I have a combo box (in asp) on a form. when the user selects a choice from the combo box, I want to store that value in a variable. Any suggestions would be greatly appreciated!

Code for combo box -
<font face="Tahoma" size="2">User Name: </font>
<%CmdUserName="SELECT PAName FROM Tbl_PATable ORDER BY PAName"
SET RsUserNameCombo=CreditCardDb.execute(CmdUserName)%>
<select name="ComboUserName" onClick="onChangeEvent2()"><option></option>
<%DO WHILE NOT RsUserNameCombo.eof%>
<option value="<%=RsUserNameCombo.Fields("PAName")%>" name="UserNameComboBox"><%=Trim(RsUserNameCombo.Fields("PAName"))%></option>
<%RsUserNameCombo.movenext
LOOP%></select></center><br>

Code for function -
<!--FUNCTION TO ASSIGN USER NAME CHOSEN-->
<script language="javascript">
function onChangeEvent2()
{
lvNameChosen = ????????????????????
</script>
 
Code:
<select name="ComboUserName" onClick="onChangeEvent2([!]this[/!])"><option></option>
<%DO WHILE NOT RsUserNameCombo.eof%>
    <option value="<%=RsUserNameCombo.Fields("PAName")%>" name="UserNameComboBox"><%=Trim(RsUserNameCombo.Fields("PAName"))%></option>
    <%RsUserNameCombo.movenext
LOOP%></select></center><br>

Code for function -
<!--FUNCTION TO ASSIGN USER NAME CHOSEN-->
<script language="javascript">
function onChangeEvent2([!]obj[/!])
{
    lvNameChosen = [!]obj.value[/!];
}
</script>

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top