2014-11-06 4 views
1

PHP를 새로 고침해야합니다. 내 onclick 후 페이지,하지만 클릭하면 일부 값을 보내야합니다 그것은 posible 있습니까? 내 PHP 페이지 새로 고침 방법 : onclick

내 코드입니다 :
<a class="btn btn-warning btn-sm" href="" onclick="this.href='insertaCotizacion.php?pais=' + document.getElementById('pais').value + '&proyecto=' + document.getElementById('proyecto').value + '&notas=' + 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> // 

내가 it을 보았다,하지만 난 페이지를 다시로드

답변

1

사용 location.reload();을 이해 해달라고.

+0

를? 내 onclick에? 내 onclick은 이미 무언가를 수행합니다 –

+0

지금은 함수에있는 모든 것을 랩 한 다음, 지금하는 일을하고 나중에는'location.reload()'를 포함시킵니다. 다음은 onclick 함수를 호출하는 것입니다. 'onclick = "theFunctionToCall();"그런 식으로. – Vanitas

1

당신이 PARAMS와 페이지 window.location.href

사용 예 다시로드해야하는 경우 : 내가 그것을 사용해야

<html> 
    <head> 
    <script> 
    function reloadUrl(){ 
    var url=insertaCotizacion.php?pais=' + document.getElementById('pais').value + '&proyecto=' + document.getElementById('proyecto').value + '&notas=' + 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>