묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
도와주세요!!! select박스에서 선택한 목록의 value를 입력하려고 합니다
2003.09.18 21:26
select박스에서 선택한 목록의 value를 글상자로에 입력받으려고 하는데 입력이 않됩니다.
어디를 수정해야 합니까
<html>
<head>
<title>폼과 폼필드</title>
<meta name="generator" content="Namo WebEditor v5.0">
<script language="JavaScript">
<!-- JavaScript
function na_changebg_namo(){
form1.formtext1.vlaue = form1.selectpd.options[form1.selectpd.selectedIndex].value
}
// - JavaScript - -->
</script>
<script language="JavaScript">
<!--
function na_call(str)
{
eval(str);
}
// -->
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form1">
<p><font face="굴림" size="3"><select name="selectpd" size="1" OnChange="na_call('na_changebg_namo()');">
<option value="1" selected>흰색</option>
<option value="2">파랑</option>
<option value="3">녹색</option>
<option value="4">하늘색</option>
<option value="5">노란색</option>
</select></font></p>
<p><font face="굴림" size="3"><input type="text" name="formtext1" value="0"></font></p>
</form>
<map name="Map"><area shape="rect" coords="13,2,93,33" href="/index.html"></map></body>
</html>
어디를 수정해야 합니까
<html>
<head>
<title>폼과 폼필드</title>
<meta name="generator" content="Namo WebEditor v5.0">
<script language="JavaScript">
<!-- JavaScript
function na_changebg_namo(){
form1.formtext1.vlaue = form1.selectpd.options[form1.selectpd.selectedIndex].value
}
// - JavaScript - -->
</script>
<script language="JavaScript">
<!--
function na_call(str)
{
eval(str);
}
// -->
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form1">
<p><font face="굴림" size="3"><select name="selectpd" size="1" OnChange="na_call('na_changebg_namo()');">
<option value="1" selected>흰색</option>
<option value="2">파랑</option>
<option value="3">녹색</option>
<option value="4">하늘색</option>
<option value="5">노란색</option>
</select></font></p>
<p><font face="굴림" size="3"><input type="text" name="formtext1" value="0"></font></p>
</form>
<map name="Map"><area shape="rect" coords="13,2,93,33" href="/index.html"></map></body>
</html>
글자가 틀렸잖아요 -0-;;;;
form1.formtext1.vlaue <---- 이 부분이 form1.formtext1.value 이렇게 되야 맞겠죠 -_-;;;
그리고 흰색이 디폴트 값이면 <input type="text" name="formtext1" value="1"> <--이렇게 되야 value랑 맞는거 아닌지 -_-;
조금 간단하게 고친 겁니다.
<html>
<head>
<title>폼과 폼필드</title>
<meta name="generator" content="Namo WebEditor v5.0">
<script language="JavaScript">
<!-- JavaScript
function na_changebg_namo(form){
document.form1.formtext1.value =form;
}
// - JavaScript - -->
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form1">
<p><font face="굴림" size="3">
<select name="selectpd" size="1" OnChange="na_changebg_namo(this.options[selectedIndex].value);">
<option value="1" selected>흰색</option>
<option value="2">파랑</option>
<option value="3">녹색</option>
<option value="4">하늘색</option>
<option value="5">노란색</option>
</select></font></p>
<p><font face="굴림" size="3"><input type="text" name="formtext1" value="1"></font></p>
</form>
<map name="Map"><area shape="rect" coords="13,2,93,33" href="/index.html"></map></body>
</html>