Need to auto fill text field based on drop down

I need javascript to do the follow bellow is the code I use

I need it so if someone selects  11 from the second drop down the amount feild would put a value 1 in place
for example
11 = 1
12 = 3
13 = 6
21 = 10
22 = 13
23 =30

I been looking everywhere and found nothing

I am very new at coding and need this
Please help
function setOptions(chosen) {
var selbox = document.myform.service;
selbox.options.length = 0;
if (chosen == " ") {
  selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');
if (chosen == "1") {
  selbox.options[selbox.options.length] = new Option('11','11');
  selbox.options[selbox.options.length] = new Option('12','12');
  selbox.options[selbox.options.length] = new Option('13','13');
if (chosen == "2") {
  selbox.options[selbox.options.length] = new Option('21','21');
  selbox.options[selbox.options.length] = new Option('22','22');
  selbox.options[selbox.options.length] = new Option('23','23');
<form name="myform" method="post" action="submit.php" onSubmit="document.myform.service.options[document.myform.service.selectedIndex].value;">
	<select name="product" size="1" onchange="setOptions(document.myform.product.options[document.myform.product.selectedIndex].value);">
	<option value=" " selected="selected"> </option>
	<option value="1">1</option>
	<option value="2">2</option>
	<select name="service" size="1">
	<option value=" " selected="selected">Please select one of the options above first</option>
	<td><input  id="amount" name="amount"></td></tr>
  <tr><td><input type="submit" value="Send" name="submit"></td></tr>

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try this
<select name="service" size="1" onchange="updateAmt(this)">
        <option value=" " selected="selected">Please select one of the options above first</option>
<script type="text/javascript">
function updateAmt(el) {
	var amt = "";
	switch(el.value) {
		case "11":
			amt = 1;
		case "12":
			amt = 3;
		case "13":
			amt = 6;
	if (amt != "") {
		document.getElementById("amount").value = amt;
	} else {}

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.