1
jquery AJAX呼び出しから取得したデータをフォームにあらかじめ入力しようとしています。 IE 7jqueryはIE 7のラジオボタンをプリロードしません。
を使用した場合、データが罰金に来ているが、私は、適切なラジオボタンをチェックしますカント次のコードは、Firefox、Safariの、とChrome
Lets assume data.description = 'student'
// I have tried both of these with no luck in IE 7
$("input[value='"+data.description+"']").attr('checked', true);
$("input[name='self_description']").filter("[value='"+data.description+"']").attr('checked', true);
<div><label><input type="radio" name="description" value="student">student</label></div>
<div><label><input type="radio" name="description" value="part time">part-time</label></div>
タイプミス、感謝されたこと。 –
jqueryはdocument.ready経由で呼び出される関数にあります –
@peledies - 'data.description'を正しく引用しようとしましたか? '.filter(" [value = '"+ data.description +"'] ")' – karim79