0

送信フォームのあるポップアップ ボックスがあります。サイトへの訪問で初めて使用すると、送信時に閉じて適切に機能します。2 回目に使用すると、送信は機能し、ページは更新されますが、ボックスは表示されたままになります。コードは次のとおりです。

<head>
    <script>  
    $(function() {    
        $( "#dialog" ).dialog();  
        $( "#Add").click(function(){
             $( "#dialog" ).dialog("close"); 
        });
    });  
</script>
</head>
    <body> <div id="dialog" title="Select Item">
        Position <%= @i %><br /><br />   
       <%= form_tag( {:controller => :cabinets, :action => :update_device_position, :position => @i , :id => @cabinet.id }, :remote => true) do %>
            <td>
                <%= select_tag :position_name, options_for_select(@selection_list) %>
            </td>
            <td>
                <%= hidden_field_tag 'position', @i %>
                <%= submit_tag "Add" ,:id=> "Add", :class => "btn" %>

            </td>
        <% end %>
       </div>  
    </body>

アイデアをありがとう。

4

0 に答える 0