1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ObjectExpected???

Discussion in 'PHP' started by lost, Nov 28, 2005.

  1. #1
    I have a selection box, that on select i want to call a function called loadData(), see below:
    
    <SELECT NAME="secondChoice" ID="secondChoice" ONCHANGE="loadData();" > 
    
    Code (markup):
    And below is a copy of my function:
    
      function loadData()
      {
         require_once('./mysql_connect.php');
         $partno = $_POST['secondChoice'];
         $query = "SELECT * FROM systemconfig_generic WHERE $partno = partno";
         $result = @mysql_query($query);
         if($result)
         {
            echo 'Part No Found: ' .$partno . '<BR>';
         }
         else
         {
            echo 'No Part No Found <BR>';
         }
      }
    
    
    PHP:
    However, when i select an item from the selection box, i keep getting Object Expected error...i have no idea what the means??

    Please help.
     
    lost, Nov 28, 2005 IP
  2. hnn

    hnn Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cant call PHP functions as Javascript....
     
    hnn, Nov 28, 2005 IP
  3. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is there such a thing as a php function?? If not, how would i go about executing the php stuff on selection change??
     
    lost, Nov 29, 2005 IP
  4. hnn

    hnn Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can't... You must reload the page...
    Or use AJAX.
     
    hnn, Nov 29, 2005 IP
  5. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK how about this question:
    I have a selection box, on change i want to do some php stuff...how would i go about doing this???

    thanks for your help in advance.
     
    lost, Nov 29, 2005 IP