Link button to dynamic page

Right now the code below works but in order to work I had to add an extra field(Team name) to the form. I would like to access this field without having to add it to the form and land in the specific dynamic page.

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';

$w.onReady(function () {
$w("#forgotPassword").onClick((event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then(() => {
//
})
.catch((err) => {
let errorMsg = err; //"The user closed the forgot password dialog"
});
});
});
export function submit_click_1(event) {
let email = $w("#email").value;
let password = $w("#password").value;
let team = $w("#teamName").value;

wixUsers.login(email, password)
.then(() => {
console.log("User is logged in");
wixLocation.to("/form/" + team);
})
.catch((err) => {
console.log(err);
$w("#errorMessage").expand();
});
}