View Single Post
  #1 (permalink)  
Old 28th May 2009, 11:14
Odeon2084 Odeon2084 is offline
D4PHP Newbie
 
Join Date: May 2009
Posts: 7
Odeon2084 is on a distinguished road
Default Not getting value from edit field

Hi everybody,

having tried my utmost to solve the following problem, I'm now very confident in having no idea how to solve it.

I just want to use a combobox in Ajax for setting a filter for a MySQL query. The Filter will be executed by an execute statement, not by the filter function.

As I had no success in using the combobox ItemIndex etc. with ajax, I filled an editfield with the combobox key-value by JS, which was not a big problem.
When now starting the ajax Script via a Button, the function does not recognize the value of the textfield. It does know its value, if I enter the keyvalue manually.

Is there any difference in entering a value by hand or setting the value via JS?

Sources:

PHP Code:
ComboBox1JSChange:

       var 
cb document getElementById("ComboBox1");
       
document.getElementById("Edit2").value=document .getElementById("ComboBox1").value;
       
//Javascript-Quelltext hier hinzufügen 
PHP Code:
function Button1JSClick($sender, $params)
       {
          echo $this->Button1->ajaxCall("UpdateDbgrid",array(),array("DBGrid1","Edit1"));
       ?>

       //Javascript-Quelltext hier hinzufügen
        return(false);
       <?php

       
}
?>

      function UpdateDbgrid($sender,$params)
      {
         //$this->Edit2->Text="fjsdkfj";
         $this->qry_rasterartikel->SQL="SELECT * FROM MB2_RASTER_ARTIKEL WHERE RASTER_ID='".$this->Edit2->text."'";
         $this->qry_rasterartikel->Active=true;
         $this->qry_rasterartikel->refresh();
         $this->Edit1->Text=$this->qry_rasterartikel->SQL;
      }
Thanks for your help!

Odeon2084

P.S:
Beeing new to Delphi for PHP programming I would welcome every hint for optimizing my sourcecode.
Reply With Quote
Sponsored Links