View Single Post
Join Date: Mar 2008
Posts: 36
Reputation: lonestar23 is an unknown quantity at this point 
Solved Threads: 0
lonestar23 lonestar23 is offline Offline
Light Poster

Problem with Radio Button error "[object HTMLInputElement]"

 
0
  #1
Sep 5th, 2008
Hello,

I am having problems retrieving correct values from two radio buttons in my AJAX script below.

The radio button values are either a 1 or 0 and always produces 0 regardless of which button is selected.

Once in AJAX, I can not have the script retreive a 1 or 0. AJAX script produces "[object HTMLInputElement]" as the response. Not sure what is going wrong.

Thanks in Advance.
Diego

  1. <script type="text/javascript">
  2. var settings = getXmlHttpRequestObject(); function saveCar() {
  3. if (settings.readyState == 4 || settings.readyState == 0) {
  4.  
  5. var car = escape(document.getElementById('car').value);
  6.  
  7. /* PROBLEM - Radio Button Processor */
  8. var proc17 = document.getElementById("search17");
  9. for (var i = 0; i < proc17.length; i++)
  10. {
  11. if (proc17[i].checked){
  12. search17 = proc17[i].value;
  13. break;
  14. }
  15. }
  16.  
  17.  
  18. settings.open("GET", 'abc.php?proc17=' + proc17 + '&car=' +car, true);
  19. settings.onreadystatechange = handleSettings; settings.send(null);}}
  20. function handleSettings() { if (settings.readyState == 4) {
  21.  
  22. }
  23. }
  24. </script>
Reply With Quote