テキストフィールド入力があり、データベース属性(ref)の値が含まれています。コードからわかるように、テキストフィールドにフォーカスすると境界線が表示され、クリックすると境界線が消えます。
私の問題は、クリックしたときに、テキストフィールドのデータが送信ボタンなしでデータベースに保存されることを望んでいることです。
<script>
$(document).ready(function(e){
$('.class1').focusin(function(){
$(this).attr('readonly',false);
$(this).css('border','1px black solid');
})
$('.class1').focusout(function(){
$(this).attr('readonly',true);
$(this).css('border','0px white solid');
})
} );
</script>
<div>Ref: <%= text_field_tag(:ref,@ref.to_s,:readonly=>true, :class => "classe1" )%> </div>
アプリケーションに値を送信するにはどうすればよいですか?