1
我想在表單中更改文件選擇並能夠重定向到同一頁面時提交表單。提交後重定向到同一頁
ie:我有這個網址:http://localhost:3000/worker_steps/basic_info。在更改下拉菜單後,我希望表單被提交併重新指向http://localhost:3000/worker_steps/basic_info。
我有這個代碼的html:
<form class="simple_form form-horizontal" novalidate="novalidate" id="edit_user_385" enctype="multipart/form-data" action="/worker_steps/basic_info" accept-charset="UTF-8" method="post">
<input class="file optional" name="user[picture]" id="user_picture" type="file"> //this is th e dropdown select input
,並在我的jQuery,我有這樣ATM:
$("#user_picture").change(function(){
//window.location = "/worker_steps/basic_info";
$(this).closest("form").submit();
});
您是否收到任何錯誤或什麼? – MTahir