0
I am trying to however not know how to send the value of select to the page.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pedido de teste</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
</head>
<body>
<div>
<h1>Produto de Teste</h1>
<p>Valor: 299,00</p>
<button onclick="enviaPagseguro();">Comprar</button><br />
<img src="loading.gif" id="loading" style="visibility: hidden">
</div>
<form id="comprar" action="https://pagseguro.uol.com.br/v2/checkout/payment.html" method="post" onsubmit="PagSeguroLightbox(this); return false;">
<input type="hidden" name="code" id="code" value="" />
<select name="itemAmount1">
<option value="10.00">Tentar obter 1000 Donate Points</option>
<option value="30.00">Tentar obter 3500 Donate Points</option>
<option value="50.00">Tentar obter 6000 Donate Points</option>
<option value="80.00">Tentar obter 9500 Donate Points</option>
<option value="150.00">Tentar obter 20000 Donate Points</option>
<option value="225.00">Tentar obter 30000 Donate Points</option>
</select>
</form>
<script type="text/javascript" src="https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js"></script>
<script>
function enviaPagseguro(codigo){
$.post('salvarpedido.php','',function(idPedido){
$('#loading').css("visibility","visible");
$.post('pagseguro.php',{idPedido: idPedido},function(data){
$('#code').val(data);
$('#comprar').submit();
$('#loading').css("visibility","hidden");
})
})
}
</script>
</body>
</html>
Someone?
But how would you send to pagseguro.php?
– Everton Figueiredo
Here {idPedido: idPedido} I know that passes idPedido more as I pass itemAmount1?
– Everton Figueiredo
,itemAmount1: $("select[name='itemAmount1']").val()
– Sam
$.post('pagseguro.php',{idPedido: idPedido,itemAmount1: $("select[name='itemAmount1']"). val()},Function(date) Picked up.
– Everton Figueiredo