

#
“form”属性について
“form”属性は“form”要素の外にある“select”要素を“form”要素と関連付ける属性です。
“form”属性の値には“select”要素を関連付ける“form”要素の“id”属性の値を指定します。同じ文書にある“form”要素であれば配置場所にかかわらず関連付けることができます。
“form”属性を省略した場合は“select”要素は祖先要素となる“form”要素に関連づけられます。
#
#
サンプルコード
<p>
<label>
あなたは猫が好きですか?:
<select name="cat" required form="sample-form">
<option value="">--選択--</option>
<option value="好き">好き</option>
<option value="とても好き">とても好き</option>
<option value="愛している">愛している</option>
</select>
</label>
</p>
...
<form method="post" action="sample-inputtag7.php" target="_blank" id="sample-form">
<fieldset>
<legend>好きな果物</legend>
<p>
<label><input type="radio" name="fruit" value="甘蕉">甘蕉</label>
<label><input type="radio" name="fruit" value="林檎">林檎</label>
<label><input type="radio" name="fruit" value="甜瓜">甜瓜</label>
<label><input type="radio" name="fruit" value="苺">苺</label>
<label><input type="radio" name="fruit" value="桃">桃</label>
</p>
</fieldset>
<fieldset>
<legend>好きな野菜</legend>
<p>
<label><input type="radio" name="vege" value="南瓜">南瓜</label>
<label><input type="radio" name="vege" value="甘藍">甘藍</label>
<label><input type="radio" name="vege" value="甘藷">甘藷</label>
<label><input type="radio" name="vege" value="西瓜">西瓜</label>
<label><input type="radio" name="vege" value="茄子">茄子</label>
</p>
</fieldset>
<p><button type="submit">送信する</button></p>
</form>
...