Hi im using a portlet to render inline HTML This i...
# suitescript
e
Hi im using a portlet to render inline HTML This is the code
Copy code
const HTMLcontent = `
                    <p>Please Enter Job # and hit Enter</p>
					<input id="jobIdForWordList"></input>
                    <script>
                        const theInput = document.getElementById('jobIdForWordList');
                        console.log('theInput', theInput)
                        theInput.addEventListener("keyup", function(event) {
                            console.log('event', event)
                            if (event.key === 'Enter'){
                                alert('Enter is pressed!');
                                window.open('${suiteletFullUrl}&jobId=' + this.value, '_blank');
                            }
                        }); 
                    </script>
                    `;
				portlet.html = HTMLcontent;
I tested this locally in the console and it works, but for some reason in the NS Portlet, the addEventListener is not getting set / triggered. Is there something im missing? Thanks
b
inspect the html rendered in the browser using your console
you should only be able to find your paragraph and input elements, netsuite strips out script elements
e
Thanks!