Answer the question
In order to leave comments, you need to log in
How to change input without reload?
Hello. Tell me which way to dig. There is an input field whose value displays the name. The name is retrieved from the database.
Task: Enter a different name there, while it should change in the database without reloading the page. A pop-up notification is desirable.
I don’t ask for a ready-made code, but there must be ready-made solutions !!?
Answer the question
In order to leave comments, you need to log in
For those who are interested. found!!!!
<script type="text/javascript">
function send(url,form_id,result_div)
{ // Отсылаем паметры
$.ajax({
type: "POST",
url: url,
data: $("#"+form_id).serialize(),
// Выводим то что вернул PHP
success: function(html)
{ $("#"+result_div).empty();
$("#"+result_div).append(html);
},
error: function()
{ $("#"+result_div).empty();
$("#"+result_div).append("Ошибка!"); } }); }
</script>
</head>
<body>
<div id="result">
<form role="form" action="javascript:send('file.php','myform','result');" id="myform" method="post">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question