5つのテキストフィールドを2つの異なる形式に連結し、それぞれの特定の形式を同じフォーム/ページの2つの別々のテキスト領域に出力しようとしています。
添付されたコードはTextArea1に出力するために正常に機能しますが、2番目のTextArea2には出力されません。
したがって、C + A、B + D、EでTextArea1にデータを入力します。そして、C + D、A、B+EでTextArea2にデータを入力します。
任意のヘルプ/アドバイスをいただければ幸いです。ありがとうございました。
<html>
<script type="text/javascript">
function setName()
{document.forms[0].TextArea1.value = document.forms[0].TextC.value + ' ' + document.forms[0].TextA.value + ', ' + document.forms[0].TextB.value + ' ' + document.forms[0].TextD.value + ', ' + document.forms[0].TextE.value}
</script>
<script type="text/javascript">
function setName()
{document.forms[0].TextArea2.value = document.forms[0].TextC.value + ' ' + document.forms[0].TextD.value + ', ' + document.forms[0].TextA.value + ', ' + document.forms[0].TextB.value + ' ' + document.forms[0].TextE.value}
</script>
<head>
</head>
<body>
<form method="post">
<table >
<tr>
<td style="width: 421px">
<input name="TextA" onkeyup="setName()" type="text" /> </td>
</tr>
<tr>
<td style="width: 421px">
<input name="TextB" onkeyup="setName()" type="text" /> </td>
</tr>
<tr>
<td style="width: 421px">
<input name="TextC" onkeyup="setName()" type="text" /> </td>
</tr>
<tr>
<td style="width: 421px">
<input name="TextD" onkeyup="setName()" type="text" /> </td>
</tr>
<tr>
<td style="width: 421px">
<input name="TextE" onkeyup="setName()" type="text" /> </td>
</tr>
<tr>
<td style="width: 421px"><strong>C+A, B+D, E</strong><br />
Created this outcome:<br />
<input name="TextArea1" onfocus="setName()" style="width: 286px; height: 90px" type="text" wrap="hard" />
<br />
</td>
</tr>
<tr>
<td style="width: 421px"><strong>C+D, A, B+E</strong><br />
Created this outcome:<br />
<input name="TextArea2" onfocus="setName()" style="width: 286px; height: 90px" type="text" wrap="hard" /></td>
</tr>
<tr>
<td style="width: 421px"><strong>Clear Form</strong><br />
<input name="Reset2" type="reset" value="reset" /> </td>
</tr>
</table>
</form>
</body>
</html>