Javascript select list/menu populates textfield with value
I have a form where a user makes a selection from a List/Menu. I want to keep the Value exactly the same as the Item Label (I will use this information in a confirmation page). The Textfield will then be populated with a defined amount from the selection made in the List/Menu.
Below is what I would like to accomplish:
When the 1st option "Member" is selected, the value displayed in the Textfield would be $100.00. If the 2nd option "Non-Member" is selected, the value displayed in the Textfield would be $150.00.
I do not want values set in the list/menu because this information will be inserted into a db. I think I need something along the lines of a If Then statement or hidden field option that will display the amounts (100.00 or 150.00) in the text field if a selection is made from the list/menu.
arendt73
ASKER
Might have closed this a bit early but how do I remove the text area - "Members pay $100.00 or Non-Members pay $150.00"? All I need is the top portion (List/Menu and the Textfield). Thank you.
Hi arendt73,
>>..how do I remove the text area - "Members pay $100.00 or Non-Members pay $150.00"?
Here is the fix:
------------------------
<html>
<head>
<script>
function toggleOpt(){
var obj=arguments[0];
var strDisplay='0';
var objVal=document.getElementById('textfield');
Open in new window