我正在尝试在表单加载时制作弹出窗口。 当您在弹出窗口中输入 ID 号时,它会存储在表单的文本字段中。 - 这是您放置 ID 号的位置。 - 这就是我想要保存该值的地方。 我正在使用 AgilePoint - 在里面插入 js 代码和 sweetalert2。 这是我想做的代码:
eformEvents.onFormLoadComplete = function()
{Swal.fire({ //rtl:true
title: 'title', html: '<p>hello</p>', icon:info, input:'text', inputLabel: 'Enter ID'
})
.then(inputValue) => {document.getElementById("Eid").Value = inputValue}
Swal.fire('Success')
})}
SweetAlert then 块将接收对象。您需要从该对象中选择值属性。
尝试如下所示。
Swal.fire({
title: 'title', html: '<p>hello</p>', input:'text', inputLabel: 'Enter ID',
}).then(({value}) => {
document.getElementById("Eid").Value = value
Swal.fire('Success')
})