Reputation: 85
I need to refresh my php. page after my onclick, but in the on click i have to send some values Is it posible?
this is my code:
<a class="btn btn-warning btn-sm" href="" onclick="this.href='insertaCotizacion.php?pais=' + document.getElementById('pais').value + '&proyecto=' + document.getElementById('proyecto').value + '¬as=' + document.getElementById('notas').value + '&formapago=' + document.getElementById('formapago').value + '&fechaentrega=' + document.getElementById('fechaentrega').value + '&flete=' + document.getElementById('flete').value + '&instalacion=' + document.getElementById('instalacion').value + '&venta=' + document.getElementById('venta').value + '&total=' + document.getElementById('total').value; return true/*I WANNA REFRESH MY PAGE HERE*/">Realizar</a> //
I saw it, but i dont understand
Upvotes: 1
Views: 1925
Reputation: 2008
if you need to reload page with params use window.location.href
Example:
<html>
<head>
<script>
function reloadUrl(){
var url=insertaCotizacion.php?pais=' + document.getElementById('pais').value + '&proyecto=' + document.getElementById('proyecto').value + '¬as=' + document.getElementById('notas').value + '&formapago=' + document.getElementById('formapago').value + '&fechaentrega=' + document.getElementById('fechaentrega').value + '&flete=' + document.getElementById('flete').value + '&instalacion=' + document.getElementById('instalacion').value + '&venta=' + document.getElementById('venta').value + '&total=' + document.getElementById('total').value;
window.location.href=url;
}
</script>
</head>
<body>
<a href="#" onclick="javascript:reloadUrl();">LINK</a>
</body>
</html>
Upvotes: 1