SweetAlert2 - After saving the input value to the text field, the return value is "
P粉445750942
P粉445750942 2023-09-16 19:03:37
0
1
477

i'm trying to make pop-up window when my form loads. and when you enter ID number in the pop-up window, it stores in the text-field in the form. enter image description here - this is where u put the ID Number. enter image description here - and this is where i want the value to be saved. I'm using AgilePoint - and inside i insert js code and sweetalert2. this is the code i'm trying to do:

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')

})}

I'm trying to popup a window when my form loads. When you enter the ID number in the popup window, it is stored in the text field in the form. Enter the image description - this is where you put the ID number. Enter the image description - this is where I want the value to be saved. I'm using AgilePoint - inserting js code and sweetalert2 in it. This is the code I'm trying to do:

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')

})}

P粉445750942
P粉445750942

reply all(1)
P粉211273535

The then block of SweetAlert will receive an object. You need to select the value attribute from this object.

Try something like below.

Swal.fire({
  title: '标题', html: '<p>你好</p>', input:'text', inputLabel: '输入ID',  
}).then(({value}) => {
  document.getElementById("Eid").Value = value
  Swal.fire('成功')
})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template