$GLOBALS['arrFilter']=array("SECTION_ID" => [1, 2] , 'INCLUDE_SUBSECTIONS'=>'Y');
if ($_GET["order"]=='hit')
{
$href1='catalog/';
}
else
{
$href1='?order=hit';
}
<select id="single" class="form-control asd" name="search" >
<option value="" disabled selected style='display:none;'>Выберите пиццу</option>
<?php foreach($article as $object): ?>
<option value ='<?=$object['name']?>' data-value1 ='<?=$object['price']?>' ><?=$object['name']?></option>
<?php endforeach ?>
</select>
function recalculatePrices() {
var total = 0;
$('.asd').each(function() {
total = total + Number( $(this).find('option[selected]').data('value1') );
});
alert(total)
$('#result').html(total);
}
function recalculatePrices() {
var total = 0;
$('.asd').each(function() {
total = total + Number( $(this).find('option[selected]').data('value1') );
});
$('#result').html(total);
}
<select id="single" class="form-control asd" name="search" >
<option value="" disabled selected style='display:none;'>Выберите пиццу</option>
<?php foreach($article as $object): ?>
<option value ="<?=$object['price']?>"><?=$object['name']?></option>
<?php endforeach ?>
</select>
$(document).ready(function() {
$('form').submit(function(e) {
e.preventDefault();
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
success: function(data) {
$('#title').html('Ваш заказ <br>'+data+'</p>');
},
});
});
});
<?php
$inp=$_POST['title'];
$inp1=$_POST['title1'];
$inp2=$_POST['title2'];
echo $inp;?>
<?php echo $inp1;?>
<?php echo $inp2;?>
$(document).ready(function() {
$('form').submit(function(e) {
e.preventDefault();
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
success: function(data) {
$('#title').html('Ваш заказ <br>'+data+'</p>');
},
});
});
});
<?php
$inp=$_POST['title'];
$inp1=$_POST['title1'];
$inp2=$_POST['title2'];
echo $inp;?>
<?php echo $inp1;?>
<?php echo $inp2;?>
let servResponse=document.querySelector('#response');
document.forms.ourForm.onsubmit=function (e) {
e.preventDefault();
let data = new FormData(document.querySelector("form"))
console.log(data)
let xhr= new XMLHttpRequest();
xhr.open("POST","mysqli.php");
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange=function (){
if (xhr.readyState===4 && xhr.status===200){
servResponse.textContent=xhr.responseText;
}
}
xhr.send(data);
};