I have a window that has multiple inputs and combo selectbox like this
main_layout = [[sg.Text('First Name', size=(15, 1)),
sg.InputText(key='gname', size=(25, 1))],
[sg.Text('V Type', size=(15, 1)),
sg.Combo(['option 1','option 2','option 3'],key="vtype",size=(25, 1)],
[sg.Text('Last Name', size=(15, 1)),
sg.InputText(key='glastname', size=(25, 1)],
[sg.Submit('Submit'),sg.Cancel('Cancel')]]
layout = [[sg.Column(main_layout,scrollable=True,vertical_scroll_only=True, size=(755,500))]]
window = sg.Window('Form', layout, font='arial',resizable=True, element_justification='l',size=(755,500))
event, values = window.read()
if event == 'Cancel' or event == sg.WIN_CLOSED:
sys.exit()
name_check = window['gname'].get().strip()
if name_check == '':
sg.popup(f"Field is Required")
window.close()
I'm already using name_check = window['gname'].get().strip()
for the name event that checks it isn't blank what I want to do is on clicking submit check all inputs to have a value and not to be blank because the code above is a form and the form is long I only wrote few of them for example
The form data will be written into a text file with a regular expression and if the value would be blank the app crashes, so I want something that I can check multiple event keys at once How can I do that?