Custom form

Hi i need some help in coding

i want to make a custom form that my client is able to update his informations

I have 3 kind of clients
FREE
BASIC
MASTER

they have some different inputs
i [ve got 1 dynamic update page to all these clients
but i need that when the free client is logged only some of the inputs are shown
when basic clients are logged more inputs are shown FREE + BASIC inputs
and when MASTER clients are logged ALL the inputs are shown

i`ve tryed a if statemnt to do that but im not having sucess

can anyone help me in how to do that ?

$w.onReady(function() {
if ($w(#input1), value === ’ FREE ’ ) {
$w(#input2), hide
$w(#input3), hide
$w(#input4), hide
});
});
else if ($w(#input1), value === ’ BASIC ’ ){
$w(#input2), hide
$w(#input3), hide
$w(#input4), show
});
});
else if ($w(#input1), value === ’ MASTER’ ){
$w(#input2), show
$w(#input3), show
$w(#input4), show
});
});

can anyone give me how to do that ?

Thanks a lot

Hi Duda,

Do you have a field for member type in your member collection?
if so, user getCurrentItem to load the member type from the current item.

Use the code skeleton below:

$w.onReady(() => {
	$w("#myDataset").onReady(() => {
		let item = $w("#myDataset").getCurrentItem();
		let memberType = item.memberType //memberType should be the name of the column in your member collection

		switch (memberType) {
		case 'FREE':
			$w(#input2), hide
			$w(#input3), hide
			$w(#input4), hide
			break;
		case 'BASIC':
			$w(#input2), hide
			$w(#input3), hide
			$w(#input4), show
			break;
		case 'MASTER':
			$w(#input2), show
			$w(#input3), show
			$w(#input4), show
			break;
		}

	});

});

awesome