Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ae galera tenho uma pagina php, com 2 input text box e keria que quando a pessoa digite o mes e o ano ele pegue no banco dinamicamente e carrega num div... to tentando usar update do ajax, estou passando os parametro via get, mais nao consigo recuperar ele, quanto a outra pagina nao eh o problema, soh preciso axar uma forma de manda os 2 valores via get e q de pra mim recuperar eles na outra pagina q vai ser carregada no div. espero q alguem possa me ajudar
obrigado
la vai o codigo
</script>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="effects.js"></script>
<script language="javascript">
<!--
try{
xmlhttp = new XMLHttpRequest();
}catch(ee){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
}
function navega_mes($mes)
{
new xmlhttp.getResponseHeader('ano');
$url = 'ind_correcao_ajax_cotent.php?ano=' + xmlhttp + '&mes=' + $mes;
var dt = new Date();
$url += '&' + encodeURI(Math.random() + '_' + dt.getTime());
new Ajax.Updater('subitens', $url , {
method: 'GET',
onFailure: function() { Element.classNames( 'subitens' ).add( 'failure' ) },
onComplete: function() {
new Effect.BlindDown ( 'subitens' , { duration: 0 } ),
new setRequestHeader("Cache-Control", "cache") }
});
}
function navega_ano($ano)
{
new xmlhttp.getResponseHeader("mes");
$url = 'ind_correcao_ajax_cotent.php?ano=' + $ano + "&mes=" + xmlhttp;
var dt = new Date();
$url += '&' + encodeURI(Math.random() + '_' + dt.getTime());
new Ajax.Updater('subitens', $url , {
method: 'GET',
onFailure: function() { Element.classNames( 'subitens' ).add( 'failure' ) },
onComplete: function() {
new Effect.BlindDown ( 'subitens' , { duration: 0 } ),
new setRequestHeader("Cache-Control", "cache") }
});
}
</script>
<form name="form" action="" method="get">
<?php
include('conexao.php');
?>
<table width="400" border="1">
<td width="50%"><input type="text" name="mes" onchange="navega_mes(value);"/></td>
<td width="50%"><input type="text" name="ano" onchange="navega_ano(value);"/></td>
</tr>
</table>
<div id="subitens" ></div>
</form>Carregando comentários...