I have input box and a submit button.
- The user will input their "reference number" (example: "hello123")
- user will click the submit button.
- after clicking the submit button, the javascript will open url link in a New browser Tab with a url link (which i assigned) plus the input of the user (which is hello123)
Assigned url is (for example): www.mywebsite.com/ after clicking the submit button, the url to open by javascript is: www.mywebsite.com/print/hello123/
i have this code:
<input type="text" id="text" />
<input type="button" id="btn" value="Submit" onClick="javascript: window.open('http://www.mywebsite.com/print/' + document.getElementById('text').value);" />
but it's really not working. any ideas what's wrong?