The value that all the links I place in the text bar is from this model:
Text bar:
<input type="text" name="url" id="url" style="width: 282px;" />
Link model:
https://sports.hummerball.com/betting/en-gb/football/OB_EV21090572/decic-vs-drita
The value I want to recover is the one between OB_EV and /, in this example the value would be:
21090572
This retrieved value, I want it to be used in url.value so when I click the button, the correct link is loaded in the iframe.
How would the script look to be able to retrieve these values?
I have no knowledge of strings to separate these values.
My current script:
<form action="" method="post" id="url-setter">
<button type="submit" name="submit">Radar 1</button>
<input type="text" name="url" id="url" style="width: 282px;" />
<iframe id="the-frame" width="347" height="282" src=""></iframe>
<script type="text/javascript">
(function () {
"use strict";
var url_setter = document.getElementById('url-setter'), url = document.getElementById('url'), the_iframe = document.getElementById('the-frame');
url_setter.onsubmit = function (event) {
event.preventDefault();
the_iframe.src = "https://sports.staticcache.org/scoreboards/scoreboards-football/index.html?eventId=" + url.value;
};
}());
</script>