2011-09-16 8 views
0

PHP로 작업 중입니다. 여기 페이지를 만들었습니다. 첫 번째 콤보 상자 항목을 선택할 때 두 콤보 상자가 있습니다. 두 번째 것은 JavaScript를 사용하는 첫 번째 콤보 상자에 따라 채워집니다. 내가 직면 한 문제는 내가 시도하고있는 곳입니다. 데이터베이스에 두 번째 콤보 상자의 데이터를 저장하려면 null 값을 발견했습니다. transition_party_id 동적으로 여기에 내가 코드자바 스크립트 데이터 게시물

function getXMLHTTP() { //function to return the xml http object 
    var xmlhttp=false; 
    try{ 
     xmlhttp=new XMLHttpRequest(); 
    } 
    catch(e) {  
     try{    
      xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); 
     } 
     catch(e){ 
      try{ 
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
      } 
      catch(e1){ 
       xmlhttp=false; 
      } 
     } 
    } 

    return xmlhttp; 
      } 

    function getparty(category) {  
    var strURL="../admin/get_partyname.php?category="+category; 
    var req = getXMLHTTP(); 

    if (req) { 

     req.onreadystatechange = function() { 
      if (req.readyState == 4) { 
       // only if "OK" 
       if (req.status == 200) {       
                document.getElementById('partydiv').innerHTML=req.responseText;      

       } else { 
        alert("There was a problem while using XMLHTTP:\n" + req.statusText); 
       } 
      }    
     }   
     req.open("GET", strURL, true); 
     req.send(null); 
    } 

} 
+1

[숨] (http://www.penny-arcade.com/comic/2002/10/11). – outis

답변

0
req.open("GET", strURL, true); 
req.send(null); 

당신은 "GET"방식으로 '널'포스트 데이터를 전송 채우기 콤보입니다.

또는 대기중인 데이터가 있습니까?

관련 문제