hi there
I’m building a custom form and I’m using custom code to autofill an input field. i attached the input field to a database so when the form submits the values of the form gets saved. everything gets saved and the input field gets filled but the value is not getting in to the database while the console log show the correct value.
import wixLocation from 'wix-location';
$w.onReady(function () {
// Get URL and parse query parameters manually
const url = wixLocation.url;
const query = wixLocation.query;
// Populate input fields from URL query parameters
if (query && query.Fname) {
$w("#firstname").value = query.Fname;
}
if (query && query.Lname) {
$w("#lastname").value = query.Lname;
}
if (query && query.ID) {
$w("#Odoo-id").value = query.ID;
}
// Select all buttons in the repeater
$w("#repeater1").onItemReady(($item, itemData, index) => {
// Attach an event handler to each button
$item("#ask-quote").onClick(() => {
// Get the name and email of the selected partner
const selectedPartnerName = itemData.title; // Assuming 'title' is the field containing partner names
const selectedPartnerEmail = itemData.email; // Assuming 'email' is the field containing partner emails
// Set the field value to match the selected partner name
$w("#Installer").value = selectedPartnerName;
// Populate the #partner-email field with the selected partner email
$w("#partner-email").value = selectedPartnerEmail;
console.log(selectedPartnerEmail);
// Scroll to the section if needed
$w('#ask-quote-box').scrollTo();
});
});
// Reset dropdownPartner when areaDropdown is changed
$w("#areaDropdown").onChange(() => {
// Reset Installer to default or empty value
$w("#Installer").value = "";
// Reset Partneremail to default or empty value
$w("#partner-email").value = "";
});
});