В html файле при нажатии кнопки вызывается javascript функция, которая вызывает функцию python
Есть ошибки в коде? Значения будут отправляться?
<form>
<center>
<h1>Создание обьявления</h1>
<div class="group">
<label>Имя:</label>
<input type="text" id="inputValue1">
</div>
<div class="group">
<label>Номер телефона:</label>
<input type="text" id="inputValue2" placeholder="+7 000-000-00-00">
</div>
<div class="group">
<label>Текст:</label>
<input type="text" id="inputValue3">
</div>
<div>
<button type="button" onClick="myFunction()">
Создать обьявление
</button>
</div>
</center>
<script type="text/javascript">
function myFunction() {
var inputValue1 = document.getElementById("inputValue1").value;
var inputValue2 = document.getElementById("inputValue2").value;
var inputValue3 = document.getElementById("inputValue3").value;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
console.log(xmlhttp.responseText);
}
};
xmlhttp.open("GET", "create_obive.py?input=" + encodeURIComponent(inputValue1) + "&input2=" + encodeURIComponent(inputValue2) + "&input3=" + encodeURIComponent(inputValue3), true);
xmlhttp.send();
}
</script>
</form>