Payload value in Uibuilder = null

Hello,
I have an input field for an e-mail address (string) on a website. This value also appears in alert, but in the payload it says null (see screenshot).

What should be the payload value in the script?

Thanks

Here is the script:

submitHandler: function () {
  let emailvalue = document.getElementById("exampleInputEmail1").value;
  alert( "Form successful submitted! E-mail: "  +emailvalue );

uibuilder.send( { 'topic': 'E-mail Adresse', 'payload': +emailvalue } )	  


}

This is the result:
wert

log in your browser's dev tools console the value to see whether you are indeed getting the correct element value
if your selector doesnt find any element it returns null

let emailvalue = document.getElementById("exampleInputEmail1").value;
console.log(emailvalue)
uibuilder.send( { 'topic': 'E-mail Adresse', 'payload': +emailvalue } )	 

Tried it without the + ?

Thanks, without "+" it works and show me the value :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.