Handle flexform event in rpw

Hello everyone, I’m creating a flexform from rpw module. The form has a textbox which is the input to handle the logic of the toop. And there are 2 buttons presenting 2 options. I want to allow the users to select an option and it will execute the code in that, so I use the on_click(def) argument to do that. The problem is when I use on_click, it seems like the value in the textbox disappear, so I can’t get the input to use in the logic of the code. Can you help me with this?