I have a database with these fields ...
insertID
insertAccount
insertAccount_No
insertPublication
I have a list box that is dynamically created so the label shows the insertAccount and value equals insertAccount_No
I have a javascript that when you select an Account from the list box it populates a textbox with the appropriate Account_No . This works just fine.
When I submit the form it is populating a second database with the Account_No in both the Account and Account Number fields. This is because the value I have selected is the Account_No.
I would like the list menu to perform two functions ... one to populate the Account field in the database with the Account name and two populate the textbox on the form with the Account_No.
any suggestions would be appreciated.
thanks, jay
insertID
insertAccount
insertAccount_No
insertPublication
I have a list box that is dynamically created so the label shows the insertAccount and value equals insertAccount_No
I have a javascript that when you select an Account from the list box it populates a textbox with the appropriate Account_No . This works just fine.
Code:
<script language="javascript">
function MoveacctNumber()
{
var myVar = document.WADAInsertForm.bkAccount.value;
document.WADAInsertForm.bkAccount_No.value = myVar;
}
</script>
Code:
<select name="bkAccount" id="bkAccount" onChange="MoveacctNumber()">
<option value="value" >Select An Account</option>
<%
While (NOT rsAccount.EOF)
%>
<option value="<%=(rsAccount.Fields.Item("insertAccount_No").Value)%>"><%=(rsAccount.Fields.Item("insertAccount").Value)%></option>
<%
rsAccount.MoveNext()
Wend
If (rsAccount.CursorType > 0) Then
rsAccount.MoveFirst
Else
rsAccount.Requery
End If
%>
</select>
When I submit the form it is populating a second database with the Account_No in both the Account and Account Number fields. This is because the value I have selected is the Account_No.
I would like the list menu to perform two functions ... one to populate the Account field in the database with the Account name and two populate the textbox on the form with the Account_No.
any suggestions would be appreciated.
thanks, jay