Submit the form and execute the href tag at the same time

Is there a way submitto create a form and execute a tag a hrefat the same time?

I need to call the <a href="sms:14085551212?body=Please see this url:[url here]">Send SMS</a>following code formtogether:

<form action="{% url 'insert_details' slug=unique %}" method="POST">
{% csrf_token %}
<input type="hidden" name="unique" value="{{ unique }}">
<input type="submit" name="ok" value="OK">
</form>

If I successfully do this at the same time, this will allow me to redirect the user to my SMS application with a pre-populated message, and also process some code in mine views.py(this is a Django application, html will appear in the Django template).

Please note that the client does not support JS, therefore, alternative solutions related to JS remain and remain beyond my competence. I am looking for some ingenuity in this task.

Note: it doesn’t work with the tag <a href=""></a>inside <button type="submit"></button>- it represents the form for me, but I cannot get the redirect to work.

0
source share

Source: https://habr.com/ru/post/1628582/


All Articles