Skip to content

Commit

Permalink
Added url params to link to certain type
Browse files Browse the repository at this point in the history
  • Loading branch information
GitStudying committed Nov 20, 2023
1 parent 8c29dba commit 9c6f656
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,24 @@ <h2>Help and information</h2>


<script>
// Get the current URL
var currentUrl = window.location.href;

// Create a URLSearchParams object from the URL
var urlParams = new URLSearchParams(currentUrl);

// Get the values of 'plat' and 'plat_from' parameters
var platUrl = urlParams.get('plat');
var platFromUrl = urlParams.get('plat_from');
var select = document.getElementById("plat_select");
var select_from = document.getElementById("plat_select_from");

select.value = platUrl;
select_from.value = platFromUrl;

// select.dispatchEvent(new Event('change'));


function getInput(id) {
return parseFloat(document.getElementById(id).value);
}
Expand Down Expand Up @@ -437,10 +455,8 @@ <h2>Help and information</h2>
var inputs = document.querySelectorAll('input[type=number]');
var filledIn = true;

var select = document.getElementById("plat_select");
var plat = select.value;

var select_from = document.getElementById("plat_select_from");
var plat_from = select_from.value;


Expand Down

0 comments on commit 9c6f656

Please sign in to comment.