What I’m trying to do:
I have textboxes inside a form to collect user inputs. One of them is named: ‘text_box_street’. User is supposed to enter the street as all uppercase, However, we all know that typing mistakes do happen. Now, I like to make sure that the user input is all uppercase by ‘coercing’ the input into uppercase.
What I’ve tried and what’s not working:
So, the textbox is bound with the ‘pressed_enter’ event handler.
This function is called when pressed:
def text_box_street_pressed_enter(self, **event_args):
street_input=self.text_box_street.text
To convert the input into all uppercase (in case not), I added the following 2 lines to the above function:
street_input = street_input.upper()
print (street_input)
Result:
Nothing is printed on the console. The upper case change does not occur. Something odd I noticed at the outset. All event handlers were active even though I did not manually activated them so I deleted all except the pressed_enter event handler. Still, nothing worked.
Anything missing in what I did? It seems to be a simple issue but I am flummoxed. Would appreciate how I can get around this issue.
Much thanks.
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
Clone link:
share a copy of your app