Disable field by condition

Hi Mythz!

I playing with Locode and would like to know how can I disable a field based on another field value.
For example I select Gift as PrizeType I want to disable the Amount field.

Thx
Tom

Not possible with Locode’s Auto Forms, you’d need to create a Custom Form for any custom behavior like this.

And what about validation between two fields? I have to create custom forms too?
I.e. if the PrizeType equals Gift the Amount has to be null.

You can get default validation behavior with the Locode’s built-in Input components with <div v-scope="Input({ .. })"> (see Custom Edit Form example). For anything else you’d need to handle it in custom submit method before submitting the request otherwise you can throw an Exception in your Server impl which should be displayed in the Forms error message.

Thanks, I throw exception in the server implementation.
Another question: How can I set default value for a field? I would like to initialize the Event Date field with the current date.

image

@Tom With a custom edit form, you can initialize the date client side as well if you want this default value visible to the end user.

Otherwise, you can use the AutoPopulate attribute so the field would become optional on the locode form, and a default value would be applied during the request automatically.