Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

No response processor error in multiple drop down menu PHP script

Posted on 2008-09-30
3
Medium Priority
?
1,543 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Marcus Bointon earned 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

722 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