33
Views
3
Comments
Solved
Disable input based on dropdown

I want to disable input for driver input if the user chooses the self-drive option in dropdown. the form is in bookingsdetail screen. i hope someone can help.

FBS.oml
Solution

Hey @Afzar Aiman 
You have missed an Entity for Drive Option that's why you was not getting a list into the dropdown.
Firstly I created a Static Entity into Data and Gave its reference to the Booking Entity then passed that Static Entity list into the Dropdown and created one Local Variable named IsCheck and gave default value True so that at start you will be able to select Self-Drive option or Manual option as your requirement when you select Self-Drive the dropdown input should get disable. And passed that Local Variable into the Enabled property of that Dropdown and created one OnChange event on that Dropdown and passed a If condition to that. 
I am attaching an Updated OML go through that OML and understand what is Updated into it.
Regards,
Adam Gangrekar. 

FBS (Updated).oml

Hey Azfar,

I think you should make the self drive option entity a static one.

so that you can easily disable the driver dropdown based the selected values.

just on the enable property of driver input write:

Booking.optionId <> Entities.options.SelfDrive

or in the parenthesis, simply provide the hard code ID for self drive.

Thanks 

Anees

Hi @Azfar Aiman 

Use a local variable to enable and disable input field and on change of dropdown value check if selected value is equal to self drive option then assign that local variable to false 

Hope it will help!!


Regards

Solution

Hey @Afzar Aiman 
You have missed an Entity for Drive Option that's why you was not getting a list into the dropdown.
Firstly I created a Static Entity into Data and Gave its reference to the Booking Entity then passed that Static Entity list into the Dropdown and created one Local Variable named IsCheck and gave default value True so that at start you will be able to select Self-Drive option or Manual option as your requirement when you select Self-Drive the dropdown input should get disable. And passed that Local Variable into the Enabled property of that Dropdown and created one OnChange event on that Dropdown and passed a If condition to that. 
I am attaching an Updated OML go through that OML and understand what is Updated into it.
Regards,
Adam Gangrekar. 

FBS (Updated).oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.