0
私は新しい開発者です、私は変更イベントの2つのラジオボタン同じ名前&のidと異なる値を作成しました。私はchangeイベントトリガーを呼び出しますが、ラジオボタンが変更される前にデフォルト値関連のコンテンツは表示されません。その問題の解決方法を教えてください。デフォルト値を表示する方法jQueryラジオボタンの変更イベントですか?
**html code**
<td valign="top" width="37.5%">
<label><input type="radio" name="client_location_c" value="germany" checked="checked" id="client_location_c" accesskey="7" title="">Global Guide Services GmbH (Germany)</label><br>
<label><input type="radio" name="client_location_c" value="romania" id="client_location_c" accesskey="7" title="">Global Guide Services SRL (Romania)</label><br>
</td>
jqueryの
$("input[name='client_location_c']").change(function() {
var receipientData = "";
if ($(this).val() == 'germany') {
receipientData = locationBasedGermanyRecipient;
} else if ($(this).val() == 'romania') {
receipientData = locationBasedRomaniaRecipient;
}
autopopulateData(receipientData);
});
$("input[name='client_location_c']").trigger('change');
あなたは '説明することができますデフォルト値関連のコンテンツが表示されないラジオボタンが変更される前に – madalinivascu
2つ以上の要素に同じIDを使用しないで、これらの要素に同じクラス名を使用できます。 –
Abhijit