thanks for answer.
I have testing the code. It's working for me but :
when I write an incorrect date I have an error dispalyed at textEdit_error_display
if then I correct the date entered previously; the error message displays on textEdit_error_display, does not automatically clear
to solve this problematic I added this line of code :
I have testing the code. It's working for me but :
when I write an incorrect date I have an error dispalyed at textEdit_error_display
if then I correct the date entered previously; the error message displays on textEdit_error_display, does not automatically clear
to solve this problematic I added this line of code :
self.textEdit_error_display.setText("")the complete code is :
import datetime as dt def insert_date(self): try: d = int(self.lineEdit_day.text()) m = int(self.lineEdit_month.text()) y = int(self.lineEdit_year.text()) date = dt.date(y, m, d) except ValueError: self.textEdit_error_display.setText("invalid fields") else: self.lineEdit_date_introduced.setText("{:%d/%m/%Y}".format(date)) self.textEdit_error_display.setText("")thanks for the code that helped me find a solution to my problem