Solved

No response processor error in multiple drop down menu PHP script

Posted on 2008-09-30
3
1,492 Views
Last Modified: 2010-04-21
I keep getting "ERROR: No response processor is available to process the response from the server." when trying to use xajax to create a PHP coded page where one drop down menu in a form determines the content of the second which determines the content of a third. These are the relevant code snippets...

require('/home/xajax/xajax_core/xajax.inc.php');

$xajax = new xajax();
$xajax->configure('debug',true);
$xajax->configure('javascript URI', '../../xajax/');
 
class myXajaxResponse extends xajaxResponse {
 
  function addCreateOptions($sSelectId, $options) {
    $this->script("document.getElementById('".$sSelectId."').length=0");
    if (sizeof($options) >0) {
       foreach ($options as $key => $value) {
         $this->script("addOption('".$sSelectId."','".$value."','".$key."');");
       }
     }
  }
}

------------

      mysql_select_db($database_Climax, $Climax);
      $query = "SELECT Manufacturer.mfg_id, Manufacturer.mfg_name FROM Manufacturer ORDER BY Manufacturer.mfg_name";
      $qryMfg = mysql_query($query, $Climax) or die(mysql_error());
      $row_qryMfg = mysql_fetch_assoc($qryMfg);

      $mfg = array();
      do {  
            $mfg[$row_qryMfg['mfg_id']]=$row_qryMfg['mfg_name'];
      } while ($row_qryMfg = mysql_fetch_assoc($qryMfg));

      mysql_free_result($qryMfg);

      $query = "SELECT Model.mfg_id, Model.model_id, Model.model_name FROM Model ORDER BY Model.model_name";
      $qryMake = mysql_query($query, $Climax) or die(mysql_error());
      $row_qryMake = mysql_fetch_assoc($qryMake);
      $totalRows_qryMake = mysql_num_rows($qryMake);
      
      $model = array();
      do {  
            $model[$row_qryMake['mfg_id']][$row_qryMake['model_id']]=$row_qryMake['model_name'];
      } while ($row_qryMake = mysql_fetch_assoc($qryMake));

      mysql_free_result($qryMake);

-----------

      // adds options to the drop down menus dependent on previous choices
      function addModels($selectId, $mode) {
            global $model;
            $objResponse = new myXajaxResponse();
            $data = $model[$mode];
            $objResponse->addCreateOptions($selectId, $data);
            return $objResponse;
      }

      $xajax->register(XAJAX_FUNCTION,'addModels');
      $xajax->processRequest();

----------------

<?php
$xajax->printJavascript();
?>
<script type="text/javascript">
  function addOption(selectId, val, txt) {
    var objOption = new Option(txt, val);
     document.getElementById(selectId).options.add(objOption);
   }
</script>

---------------

              <tr>
                <td width="80" class="formtxt1">Make:</td>
                <td><select name="cbMake" class="formbox1" id="cbMake" onchange="xajax_addModels('cbModel', document.catsearch.cbMake.value)">
                  <option value="0" selected>All</option>
                  <?php
foreach ($mfg as $key => $value) {  
?>
                  <option value="<?php echo $key?>"><?php echo $value?></option>-->
                  <?php
}
?>
                </select>
</td>
              </tr>
              <tr>
                <td class="formtxt1">Model:</td>
                <td>
                        <select name="cbModel" class="formbox1" id="cbModel">
                  <option value="0" selected>All</option>
                  </select></td>
              </tr>

I have firebug installed but have no idea how to see what xajax is sending.
0
Comment
Question by:Computer_Dilo
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Marcus Bointon earned 500 total points
ID: 22612418
> I have firebug installed but have no idea how to see what xajax is sending.

Well it's probably best to sort that out first. When you are viewing the page, click the firebug icon, and enable network and scripting debugging for your site. Then you'll need to refresh the page. After that, whenever you make an ajax request, it will be listed on the firebug console, and if you click the disclosure triangle on it, you'll be able to see the original request, and be able to reload the response.

Obviously the request should look like it's asking for the right stuff and the response should contain what you expect it to.
0
 

Author Comment

by:Computer_Dilo
ID: 22612444
You think I could find that information anywhere :(

Thank you!

I'll have a look asap - I've actually got the squirts and just gone to a PHP refresh instead to get the thing going.
0
 

Author Closing Comment

by:Computer_Dilo
ID: 31501593
I have switched to Ajax instead after messing around. Cheers for help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysqli 3 23
RELATED: How do I fix this error:  Warning: strpos(): Empty needle on line 122 11 32
PHP: concatenate query 13 45
Scope of $_SESSION 17 30
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now