|
|
|
|
|
|
|
|
import "jquery-ui" |
|
|
import "jquery-ui" |
|
|
import "./form.scss" |
|
|
import "./form.scss" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
$(document).ready(function () { |
|
|
initCollectionWidget(); |
|
|
initCollectionWidget(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$(item).find('input,textarea').each(function (y, field) { |
|
|
$(item).find('input,textarea').each(function (y, field) { |
|
|
let $field = $(field); |
|
|
let $field = $(field); |
|
|
//Chanegment ID |
|
|
//Chanegment ID |
|
|
let posId = SovTools.indexOfLastDigit($field.prop('id')); |
|
|
|
|
|
let idPrefix = $field.prop('id').substr(0, posId); |
|
|
|
|
|
let idSuffix = $field.prop('id').substr(posId + 1); |
|
|
|
|
|
|
|
|
let posIdPrefix = parseInt(SovTools.indexOfFirstDigit($field.prop('id'))); |
|
|
|
|
|
let posIdSuffix = parseInt(SovTools.indexOfLastDigit($field.prop('id'))); |
|
|
|
|
|
|
|
|
|
|
|
let idPrefix = $field.prop('id').substr(0, posIdPrefix); |
|
|
|
|
|
let idSuffix = $field.prop('id').substr(posIdSuffix + 1); |
|
|
|
|
|
|
|
|
|
|
|
SovTools.log(idPrefix); |
|
|
|
|
|
SovTools.log(idSuffix); |
|
|
$field.prop('id', idPrefix + i + idSuffix); |
|
|
$field.prop('id', idPrefix + i + idSuffix); |
|
|
|
|
|
|
|
|
//Chanegment Name |
|
|
//Chanegment Name |
|
|
let posName = SovTools.indexOfLastDigit($field.prop('name')); |
|
|
|
|
|
let namePrefix = $field.prop('name').substr(0, posName); |
|
|
|
|
|
let nameSuffix = $field.prop('name').substr(posName + 1); |
|
|
|
|
|
|
|
|
let posNamePrefix = SovTools.indexOfFirstDigit($field.prop('name')); |
|
|
|
|
|
let posNameSuffix = SovTools.indexOfLastDigit($field.prop('name')); |
|
|
|
|
|
let namePrefix = $field.prop('name').substr(0, posNamePrefix); |
|
|
|
|
|
let nameSuffix = $field.prop('name').substr(posNameSuffix + 1); |
|
|
$field.prop('name', namePrefix + i + nameSuffix); |
|
|
$field.prop('name', namePrefix + i + nameSuffix); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |