0
Good afternoon,
I have these two cases:
I have a modal with
<form action="{{url_for('rota')}}"
and on this route I am giving an update on the information, my problem is in the return of this POST, which I put to return to modal, if possible with a message "Data updated successfully"dados.con_contato = request.form.get('modalTelContato') dados.con_contato_observacao = request.form.get('modalRecado') update = con_contatos.update(dados) return o que eu coloco aqui???
I have a "Save" button set with "Submit" and in my form I have a
onsubmit="return closeSelf(this);"
In this script I did so:
function closeSelf (f) {
f.submit();
window.close();
}
My problem is that if I leave it like this, it closes without giving Ubmit, if I take out the window.close(), it runs Ubmit but does not close the current window!
You have two different questions. You should put them separately.
– Aurium
Another tip: Think carefully about the title. It should describe the problem succinctly. Your problem is not knowing how to return a function, but how to respond to an HTTP request.
– Aurium
Return should not be the page to which the comrade will be redirected?
– Elton Nunes
@Eltonnunes, yes, should show a message of "data changed successfully" and close the modal.
– Antonio Carlos
I refer to url_for(page,)
– Elton Nunes