Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Help with ComboBox

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
rodrigomaia
New one
New one


Joined: 27 Jun 2008
Posts: 1

PostPosted: Fri Jun 27, 2008 1:39 pm    Post subject: Help with ComboBox Reply with quote

I got this code that was working. I tried to do a multiple select field. In the first page you select the number of selects per line. Each select is in a DIV with id=mostracomboi where the 'i' at the end of the word is a variable. <div id="mostraCombo<?=$i?>"> This 'i' i pass as a parameter.

in the html i call ->

<select name="grupo" onchange="javascript:mudar(this.value,<?=$i?>);">

Look at the code.

var retorno;
var id;
var combo;
function CarregaArquivo(url,valor)
{

retorno = null;
if (window.XMLHttpRequest) {
retorno = new XMLHttpRequest();
retorno.onreadystatechange = processReqChange();
retorno.open("GET", url+'?grupo='+valor, true);
retorno.send(null);
} else if (window.ActiveXObject) {
retorno = new ActiveXObject("Microsoft.XMLHTTP");

if (retorno) {
retorno.onreadystatechange = processReqChange();
retorno.open("GET", url+'?grupo='+valor, true);
retorno.send();
}
}
}

function processReqChange()
{

combo ='mostraCombo'+id;
alert(combo); //just to test the value of combo//

if (retorno.readyState == 4)
{
if(retorno.status == 200)
{
/

document.getElementById(combo).innerHTML = retorno.responseText;

}
else
{

alert("Houve um problema ao obter os dados:\n" + retorno.statusText);
}
}
}


function mudar(valor,id2)
{
id=id2;
//CARREGA O ARQUIVO EXTERNO DO AJAX
CarregaArquivo("mostra_combo.php",valor,id2);
}

whats wrong??????

Thanks in advanced
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert