Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Programming > Javascript and Ajax
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28th May 2009, 12:14
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28th May 2009, 14:17
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

It's an undocumented feature

When changing edits with js you also must change a hidden field which is really the only thing checked on the server.

findObj('Edit1_hidden').value=new value also;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 28th May 2009, 14:36
D4PHP Newbie
 
Join Date: May 2009
Posts: 7
Odeon2084 is on a distinguished road
Default

Quote:
t's an undocumented feature
Thanks, you made my day!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 03:39.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use