1
votes

I'm developing appointment system with PHP. I want to make manipulation on input date calendar. So if a client wants to create appointment, client will select the desired day/month/year.

When a different client wants to create appointment, selected fields so other day/month/year will be display disabled. How can i do this. Do you have anyone idea?

If you can show simple example, i will be very happy.

Thanks, regards.

1
what you mean by When a different client wants to create appointment, selected fields so other day/month/year will be display disabled? - Amanjot Kaur
Are you saying if someone has already that appointment, others should not be able to select that date? - Amanjot Kaur
Yes! Absolutely. Can you help me? - natxchill
i will make first time - natxchill

1 Answers

1
votes

you can use out focus or blur method so that you can disable the previous date from selecting. for eg. if client selected date = 25/12/2019

if another client selected the same date then

$('input').blur(function(){
  if($('client_2_selected_date').val() == client_1_selected_date){
     alert("date matched please select another date");
     $('client_2_selected_date').val("")
  }
else{
  alert("different date")
}
})