I am trying to do a javascript function that opens a URL in a new page, but i need to get same data from a from, example:
i have a text field and i put numbers like 234543256 and when i click submit i need to have a url like
So it should be some url + text field datas + some url
to be opened in a new page. Can anyone help?
I have done this until now:
<html>
<head></head>
<body>
<script type="text/javascript" >
function tracking() {
var url="http://somepage.com/somefile.php?=";
var nr="022300134609";
var endurl="&someotherthings";
var fullurl=url + nr + endurl;
window.open(fullurl);
}
</script>
<form id="test">
<input type="textfield" id="nr" name"test">
<input type="submit" name="submit" onclick="tracking();">
</form>
</body>
</html>
But i need to get the value of the “nr” from the form to add.
Use window.open() method.
test.html
test2.html