I’m in the middle of building a site on Editor X. I’ve created a new page in the Members Area for a form in a multistate box. When a member completes the form there is an automation to assign a badge to them.
There are 3 states in the multistate box:
- submitInfoFirst: This should be visible to any user who does not have the badge (i.e. they have not completed the form before)
- viewInfo: This should be visible to any user with the badge. It is a read-only version of the form.
- submitInfo: This is the version of the form users with the badge will see if they choose to edit their answers.
I did this weeks/months ago and I thought all was well. But yesterday going back to it, the submitInfoFirst form is not working. Within Editor X, the default values for the various input fields has the ‘Enabled’ box ticked. But when I inspect the element in preview or on the live site they are all disabled. The relevant page is here at the moment (would need an account to view).
There is additional code on the page (as below), but I don’t think any of this would be the problem??
import { currentMember } from 'wix-members';
import { getMemberBadges } from 'backend/getBadges'
//
// If BIPOC community member, then run communityMemberview function e.g. read only mode
// Otherwise display default which is the Submit info first state
//
const options = {
fieldsets: [ 'FULL' ]
}
currentMember.getMember(options)
.then((member) => {
getMemberBadges(member._id).then((badges) =>{
if(badges[0].badgeIds.includes('2e2a7cbd-0cc1-4a2c-9882-fe6f4b5e293a')){
communityMemberView();
}
})
});
function communityMemberView(){
$w('#editButton').show();
$w('#multiStateBox').changeState("viewInfo")
}
// If the user has ticked to confirm they identify as BIPOC then display a tick on View info state
$w('#dataset1').onReady(() => {
let items = $w('#dataset1').getCurrentItem();
if (items['identifyBipoc']) { $w('#tick1').show(); }
else $w('#tick1').hide();
});
// If the user has ticked to confirm they want emails then display a tick on View info state
$w('#dataset1').onReady(() => {
let items = $w('#dataset1').getCurrentItem();
if (items['emailPermission']) { $w('#tick2').show(); }
else $w('#tick2').hide();
});
// When edit button clicked...
export function editButton_click(event) {
$w('#multiStateBox').changeState("submitInfo");
$w('#editButton').hide();
$w('#cancelButton1').show()
}
// When submit button clicked...
export function submitButton_click(event) {
$w('#dataset1').save();
$w('#multiStateBox').changeState("viewInfo");
$w('#topPage').scrollTo()
$w('#editButton').show()
$w('#cancelButton1').hide()
}
// When cancel buttons are clicked
export function cancelButton1_click(event) {
cancelButton();
}
export function cancelButton2_click(event) {
cancelButton();
}
function cancelButton(){
$w('#multiStateBox').changeState("viewInfo");
$w('#editButton').show()
$w('#cancelButton1').hide()
}