[Fixed] Escaping embedded quote

I am trying to find a row in a datatable that matches on a criterion that may contain an embedded quote.

To do that, I call a server function, something like:
anvil.server.call('update',self.username,self.item['rest'],self.radio_button_1.get_group_value())

This works fine except when self.item[‘rest’] contains an embedded quote, like when
self.item['rest'] = McDonald's

On that row I get the error on the row calling the server function:
ExternalError: Error: Syntax error, unrecognized expression: input[name='McDonald's']:checked

What’s the right way to do this?

1 Like