選択内容に応じてテーブルの背景色が適切なオプション値に変更される基本的なオンライン フォームを作成しようとしています。
私が抱えている問題は、フォームが送信されたときに、必要なテキストではなくオプション値が送信されていることです。
onChange を変更する方法、またはおそらくより良い方法はありますか?
ご協力いただきありがとうございます。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Survey</title>
</head>
<body>
<table border="0" width="21%" cellspacing="0" cellpadding="0" height="20">
<tr>
<td id = "mycell">
<p style="margin-top: 10px; margin-bottom: 10px">
<select name="q11" <select onChange="if(this.selectedIndex!=0)
document.getElementById('mycell').bgColor=this.options[this.selectedIndex].value">
<option value="#FFFFFF">Choose a factor...
<option value="#F6B23E">My Company – feeling positive about who I work for
<option value="#F58386">My Leaders – being inspired by my business leaders
<option value="#EF3135">My Boss – mutual respect and understanding
<option value="#F58386">My Team – enjoying who I work with
<option value="#AD6AA3">My Job – enjoying what I do
<option value="#95CAA0">My Personal Growth – learning, development and prospects
<option value="#4FA761">My Deal – satisfaction with pay and benefits
<option value="#95CAA0">My Wellbeing – having a balanced life
</select></td>