我目前正在尝试使用WTFORM重写表单
当我尝试替换JS输入创建时,我陷入了困境。我有以下jQuery派,我想用一个WS调用来替换它,以在WTFORM类中插入一个新字段。
$(
'<div class="MAIN_order_' + (cptOrder + 1) + '" style="display: none">' +
' <div class="form-group">' +
' <label for="orderNumber_' + (cptOrder + 1) + '">' + gt.gettext('ORDER_NUMBER') + ' ' + (cptOrder + 1) + ' <a href="#removeorder" class="ORDER_' + (cptOrder + 1) + '" onclick="removeOrderNumber(this)"><i class="fa fa-minus-square" aria-hidden="true"></i></a> </label>' +
' <div class="input-group mb-2">' +
' <div onclick="drawRectangle(document.getElementById(\'orderNumber_' + (cptOrder + 1) + '\'))" class="input-group-prepend" style="display:none;">' +
' <div class="input-group-text"><i class="fas fa-eye" aria-hidden="true"></i></div>' +
' </div>' +
' <input autocomplete="off" required name="facturationInfo_order_number_' + (cptOrder + 1) + '" id="orderNumber_' + (cptOrder + 1) + '" type="text" class="form-control" onfocusout="ocrOnFly(true, this, true); removeRectangle()" onfocusin="ocrOnFly(false, this, true)">\n' +
' </div>' +
' </div>' +
' </div>'
).insertAfter(lastOrder).slideToggle();
这可能吗?如果是,我该怎么办?