SUBMIT button issue - Not all fields are getting updated

Hello,

Background:
My site (www.pbjamplatform.com) leads users to same questionnaire (Free Self Assessment) from three different sources (free assessment button on Home page, initial assessment and current assessment buttons on PB-JAM journey page from within Members area). Once questionnaire is filled (partial fill is also accepted), and if the user presses “submit” button, all questionnaire answers are transferred to a collection as new item. This new item is identified by First Name, Last Name and Email Address of the user. This is where I am having an issue.

My problem:
If the user is not logged in, uses the questionnaire, enters first name, last name and email address, then all is well.
If the user is logged in, uses the questionnaire, first name, last name and email address are retrieved and displayed in text input boxes. However, now if user clicks Submit button, all questionnaire responses are transferred to the collection’s new item, but the first name, last name and email address are not transferred.

Observation:
If I “edit” any field, e.g. let’s say that the retrieved first name is John. If I click and edit John in any way), then the field is transferred correctly. But, if I don’t edit the field, these three fields don’t get transferred.

Any clues?

Since you are using a Submit button, I’ll go a step further and assume that the form is connected to a dataset, and that the button is “connected” to the Submit action.

To set the fields of the dataset item to the values of the input components, you should use setFieldValue or setFieldValues .

Thanks Yisrael! Yes, it is the button connected to Submit action of my dataset.

Tried SetField Value route, but though didn’t get any errors, the data is not getting recorded to destination fields. Here is the code:
//Set dataset fields to input fields
$w( “#dataset1” ).setFieldValues( {
“firstName” : $w( “#input1” ).value,
“lastName” : $w( “#input2” ).value,
“emailAddress” : $w( “#input3” ).value,
} );

Dataset1 has been set to Write mode.

bump

Oh, and I also added onReady snippet to make sure that dataset is loaded… but, still no luck

Tried to use wix-storage to store and retrieve these fields, but it doesn’t seem to work with data hooks?

//Set dataset fields to input fields
$w( “#dataset1” ).onReady( () => {
$w( “#dataset1” ).setFieldValues( {
“firstName” : $w( “#input1” ).value,
“lastName” : $w( “#input2” ).value,
“emailAddress” : $w( “#input3” ).value,
} )
});

bump