2

カラーボックス ポップアップ検索フォームから入力フィールドに入力/上書き (存在する場合) しようとしましたが、変数を入力フィールドに戻せません。

これはメインページです:

link rel="stylesheet" href="jquery/css/ui-darkness/jquery-ui-1.10.1.custom.css">
<script src="jquery/js/jquery-1.9.1.js"></script>
<script src="jquery/js/jquery-ui-1.10.1.custom.js"></script>
<script src="jquery/colorbox/jquery.colorbox-min.js"></script>
<link rel="stylesheet" href="jquery/colorbox/colorbox.css" />

<script>
$(function() {
var kid = $('#Kontaktname').val();
$("#Kontaktname").colorbox({
    href:"contact_search_popup.php?s_contacts_id=" + kid,
    iframe:true,
    innerWidth:850,
    innerHeight:400,
    opacity:0.1,
    overlayClose:false,
    });
});
</script>

<p><input type="text" id="Kontaktname" value="1001" name="Kontaktname"></p>

<p id="test">
return value:
</p>

これはカラーボックスのポップアップ ページです:

link rel="stylesheet" href="jquery/css/ui-darkness/jquery-ui-1.10.1.custom.css">
<script src="jquery/js/jquery-1.9.1.js"></script>
<script src="jquery/js/jquery-ui-1.10.1.custom.js"></script>
<script src="jquery/colorbox/jquery.colorbox-min.js"></script>
<link rel="stylesheet" href="jquery/colorbox/colorbox.css" />

<input type="submit" id="formSubmit" class="test" value="{Label1}" name="formSubmit"> 

<script>
 $(document).ready(function() {
 $("input.test").click(function() {
 window.parent.$("#kontaktname").text($(this).val()); // works
 window.parent.$("#test").text($(this).val());        // dont work !!!
 parent.$.colorbox.close();
 });
 });
 </script>
4

0 に答える 0