Getting ids and modifying fields in Wix Forms v2 via javascript

I’m having trouble with
Finding ids of form elements and changing date pickers’ ranges and dropdown’s value dynamically. Form was created with Wix, it’s in my dashboard Customers & Leads → Forms and Submissions.

Working in
Wix Editor

Site link
Test site: https://www.holidaysaltrock.co.za/test?rc=test-site

What I’m trying to do
I want to show the form on my main page (non-dynamic) and on multiple dynamic pages.

1 ) I need to grab IDs of the date pickers “Check-in” and “Check-out” and “I’m interested in“ dropdown or modify them without grabing IDs.

  1. I want to limit both of the date pickers to only future dates before March 1st 2026.

  2. I want to set the value of “I’m interested in” dropdown to a certain option depending which dynamic page I am on, example if the title of the current element of the dynamic page is “Whole House”, then then the dropdown default value should be “House”

import wixWindowFrontend from “wix-window-frontend”;

$w.onReady(function () {

let currentItem = $w(“#dynamicDataset”).getCurrentItem();

let house_option_index = … get index of “House” option in Dropdown “i_m_interested_in”
let backpackers_option_index = … get index of “Backpackers” option in Dropdown “i_m_interested_in”

if (currentItem.title.includes(‘house’))
{
$w(“#formInquiry”).setFieldValues({
i_m_interested_in : house_option_index, – INCORRECT
i_m_interested_in.selectedIndex : house_option_index – INCORRECT
});
}
else if (currentItem.title.includes(‘backpacker’))
{
$w(“#formInquiry”).setFieldValues({
i_m_interested_in :backpackers_option_index , – INCORRECT
i_m_interested_in.selectedIndex : backpackers_option_index – INCORRECT
});
}

What I’ve tried so far
I searched in documentation for a way to get the element ids of the fields in a Wix form.


Extra context
I know if I made a custom form using elements + CMS I could have more flexibility, but since I had already made a Wix form I want to try to bend it to its limits.