修復自動填值時,會覆蓋name

This commit is contained in:
邱博亞 2023-06-05 23:03:58 +08:00
parent d1266dcfa1
commit df25703375
1 changed files with 3 additions and 1 deletions

View File

@ -530,7 +530,9 @@ class AsksController < ApplicationController
old_input = old_.find('input, select');
if(new_input.length != 0 && old_input.length != 0){
if(new_input.length == old_input.length){
old_.clone().replaceAll(new_);
var old_clone = old_.clone();
old_clone.find('input, select').attr('name', new_input.attr('name'));
old_clone.replaceAll(new_);
}
}
}