basta fare un semplice escape degli apici:

onsubmit='return confirm(\'vuoi cancellare?\')'



Ciao