Link to home
Start Free TrialLog in
Avatar of Ivan Golubar
Ivan Golubar

asked on

Ajax success function not processing of "document.getElementById" function

Next is from header:
 Select project from the list: <select id="selectProjectID" onfocus="onFocusSelectProject()">
                   </select></br></br>

Open in new window

And next is ajax call.
  function getLastOpenedProject(){  //_____________getLastOpenedProject(){ 
  $.ajax({
  method:"POST",
  url: '/wp-content/themes/net4/PgetJson.php',
  data:  {
      "getLastOpenedProject":1,
       "weGotTheuser":weGotTheuser
   datatype: "text",
    success: function(strdate){
         var selectProject3 = document.getElementById("selectProjectID");
      selectProject3.value=strdate;
      alert(strdate);
     }
  }); 
 }

Open in new window


"Alert" gives me right answer from DB.  What is then wrong in my code? I don't get anything in "select " element.
ASKER CERTIFIED SOLUTION
Avatar of Leonidas Dosas
Leonidas Dosas
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ivan Golubar
Ivan Golubar

ASKER

Thank you.