Enable Button based on the check in date
Question

I am making a booking app, but I am having a problem in my check in button


I want to enable my check in button only if the current date is the same to the check in date




Solution

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Hi


I tried your suggestion, but after loading the web screen the Check in button is still enabled :(


Marcelo Ferreira wrote:

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Hi Sir,

I tried it again and it worked thank you :)


Hi Gerald,

Shouldn't be the other way around and use = instead of <>(different) to enable the check in button? Make sure that the check in date input as an onChange event that ajax refresh the checkin button.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gerald,

Shouldn't be the other way around and use = instead of <>(different) to enable the check in button? Make sure that the check in date input as an onChange event that ajax refresh the checkin button.

Regards,

Marcelo


Thank you

So my statement should be

CurrDate() = Bookingform.Record.Booking.CheckInDate

Solution

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Hi


I tried your suggestion, but after loading the web screen the Check in button is still enabled :(


Marcelo Ferreira wrote:

Hi Gerald,

Yes that is right. Let us know if it worked for you.

Regards,

Marcelo

Hi Sir,

I tried it again and it worked thank you :)


Do you have an OnChange action with an ajax refresh of the checkin button?.

Ricardo Cruz wrote:

Do you have an OnChange action with an ajax refresh of the checkin button?.

No I dont have OnChange Action since what I want is that immediately after the web screen load, the Checkin button must be disabled if the Checkin Date of the selected booking is not the same to the Current Date


Gerald Emmanuel Malaca wrote:

Ricardo Cruz wrote:

Do you have an OnChange action with an ajax refresh of the checkin button?.

No I dont have OnChange Action since what I want is that immediately after the web screen load, the Checkin button must be disabled if the Checkin Date of the selected booking is not the same to the Current Date


HI Gerald,

What I understand from your comment is that you want to enable or disable the check button when screen loads not opon date selection. So I am assuming your form will be disabled hence date can not be change and so onchange is not required. 

I have attached one sample oml assuming you are using traditional web app.

Samples.oml

Ricardo´s suggestion looks like what you are really missing.


So you can handle it using a Boolean variable, for CheckIn button Enabled property set by a boolean variable. Default value of that variable will be false. So when screen load, its value will be false and checkin button will be disable.

Now if user choose any date, then onChange should call. In onChange you compare selected date is equal to current date then make boolean variable true and refresh widget. It should work.

Thanks.

Hi Gerald,

With the expression you used it should work. Can you share you module so I can check it?

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gerald,

With the expression you used it should work. Can you share you module so I can check it?

Regards,

Marcelo

As per Marcelo suggestion, it will work with expression as well. I think you are missing onChange event as suggested by Ricardo.


Gerald Emmanuel Malaca wrote:

I am making a booking app, but I am having a problem in my check in button


I want to enable my check in button only if the current date is the same to the check in date





Hi, Use the text on change event to enable/disable button on the date field. By default, it should hide and the rest logic u can add on the OnChange event of the Date field.


Thanks

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