Hi Guys,
Totally new in wix and in the coding world, still trying to learn and develop my own website. I am facing an issue and I am sure that I am missing something here, need your guidance and support.
Scenario :
I have a repeater , having some fields which are connected with "Pkg_TourPackage" Database
The field "day1" is populating the Daywise Plan of my tour package in the wix website
Requirement :
Whenever user clicks the submit button, the day wise plan values needs to be inserted in database, not the text in the text field.
Issue :
System is not inserting the connected values in the database, it is inserting the "text"of the Field.
Code:
$w('#btnQuote').onClick(async(Event, $w)=>{ let firstname = ($w("#firstName").value); let lastname = ($w("#lastName").value); let daywiseplan = ($w("#day1").text); let packagename = ($w("#text7").text); let insert ={ "firstName": firstname, "title":packagename, "daywiseplan":daywiseplan } wixData.save("Trial1",insert) })
Repeater :
Custom Form :
Output :
daywiseplan output is getting inserted as "1", because the actual text of "day1" field is "1", system is not capturing the connected value.
Rather than:
let firstname=($w("#firstName").value);
Try:
let firstname=$w("#firstName").value;
Is the "Itinerary Overview" and "Confirmation Form" on the same page? If they are, it is possible you can extract the #day1 value directly from the dataset associated to the repeater using getItems() Otherwise I would recommend saving and accessing the users itinerary data using Session or Memory storage through Wix-Storage