This topic is locked

Dropdown fields in edit mode works not fine

5/21/2007 6:03:26 AM
PHPRunner General questions
R
rainerwolf author

Hello,
the function Lookup Wizard Dropdown works sometimes good and sometimes not good. I have a table with 4 columns and a table with 2 columns, all of them will be show in my edit form. The raw database has stored the content im my table. But when the edit form will be displayed after storing data, then the fields from the table with 2 columns have a content "Please select" and the others have the correct content.
And please help me, what must i do, when i want to hide the dependent fields. I've tried it with delete in the edit form, but then the content will not be stored in database.
Thanks for help
PHPRUNNER 4.0 Build 257

Alexey admin 5/21/2007

Hi,
please publish your project on Demo account and give me a link to it along with instructions on reproducing the error.

Post link here or send to support@xlinesoft.com
Not really sure why do you need to hide dependent fields.

Describe your task a bit more.

R
rainerwolf author 5/21/2007

Hello Alexey,
the purpose for the secondary dropdown fields is:
I need the content of this fields, because i must fill them with the worth of following table, and the user shell not to see the content of religionkey.

I must only write the content into the personally table.

For example, i have a table religion with following source fields:
religionname (varchar) 25

relgionkey (varchar) 4
Content of religionname is: evangelisch, katholisch, etc...

Content of religionkey is: ev, rk, rtc.
and another table with personally informations:
Firstname (varchar) 40

Surname (varchar) 40

religion (varchar) 25

relgionkey (varchar) 4
When the user enters his data, and fills out religion (dropdown field from religion) then the religionkey must have the correct worth.

e.g. User take katholisch, then the religionkey must have rk.
If you can give me another solution as described above, then i will gladly take it.
What do you mean with demo account?
Best regards

R
rainerwolf author 5/21/2007

Hello Alexey,
in the moment, as i make a little application to show you my problem, i see the mistake i have made. I took the wrong link field in the dropdown menu.
i am very sorry about this and i hope, that you have not so much work with my question. Your Dropdown works great ans i never see a programm like this.
But, is it possible, that you give me an other solution to fill out the fields automatically because the user shell not see the worth.
Can you help me about this probllem, i have an event in "after successfully registration" looks like this:
------------------

function AfterSuccessfulRegistration()

{

//** Insert a record into another table ****
global $conn,$values;

$strSQLInsert = "insert into swh_registrations_log (Familienname, Vorname, Strasse, PLZ, Wohnort, angelegtvon, satzhinzuam, ipadresse) values

('".$values["nachname"]."'

,'".$values["vorname"]."'

,'".$values["nachname"]."'

,'".$values["PLZ"]."'

,'".$values["nachname"]."'

,'".$_SESSION['UserID']."'

,'".date('Y-m-d H:i:s')."'

,'".$_SERVER['REMOTE_ADDR']."' )";

db_exec($strSQLInsert,$conn);
//**** Uppercase first character ***
$values["nachname"]=ucfirst($values["nachname"]);

$values["vorname"]=ucfirst($values["vorname"]);

}
After insert in the database the first Characters are not in uppercase.
Kind Regards
Rainer

J
Jane 5/22/2007

Rainer,
you need to define $values["nachname"] and $values["vorname"] before your query:

function AfterSuccessfulRegistration()

{

global $conn,$values;

//**** Uppercase first character ***

$values["nachname"]=ucfirst($values["nachname"]);

$values["vorname"]=ucfirst($values["vorname"]);
//** Insert a record into another table ****

$strSQLInsert = "insert into swh_registrations_log (Familienname, Vorname, Strasse, PLZ, Wohnort, angelegtvon, satzhinzuam, ipadresse) values

('".$values["nachname"]."'

,'".$values["vorname"]."'

,'".$values["nachname"]."'

,'".$values["PLZ"]."'

,'".$values["nachname"]."'

,'".$_SESSION['UserID']."'

,'".date('Y-m-d H:i:s')."'

,'".$_SERVER['REMOTE_ADDR']."' )";

db_exec($strSQLInsert,$conn);

}


Regarding the question about dependent dropdown boxes.

I recommend you to fill relgionkey field in the Before record added or Before record updated event on the Events tab. Here is a sample code:

global $conn;

$str = "select relgionkey from religion where religionname='".$values["religion"]."'";

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

$values["relgionkey"] = $data["relgionkey"];

R
rainerwolf author 5/23/2007

Hello Jane,
i have define the uppercase function now like this:
global $conn,$values;
$values["nachname"]=ucfirst($values["nachname"]);

$values["vorname"]=ucfirst($values["vorname"]);

$values["street"]=ucfirst($values["street"]);

$values["city"]=ucfirst($values["city"]);
$strSQLInsert = "insert into swh_registrations_log (Familienname, Vorname, Strasse, PLZ, Wohnort, angelegtvon, satzhinzuam, ipadresse) values

('".$values["nachname"]."'

,'".$values["vorname"]."'

,'".$values["street"]."'

,'".$values["PLZ"]."'

,'".$values["city"]."'

,'".$_SESSION['UserID']."'

,'".date('Y-m-d H:i:s')."'

,'".$_SERVER['REMOTE_ADDR']."' )";

db_exec($strSQLInsert,$conn);
}
but it doesn't work.
And the solution about dependent dropdown boxes gives me back an Error:
Please look the example at www.rainerwolf.de and see what happens
kind regards
Rainer

J
Jane 5/23/2007

Rainer,
it seems that you didn't replace field name in the event code with actual field names.
You can publish your project on Demo Account and send to [email=support@xlinesoft.com]support@xlinesoft.com[/email] a URL to your pages.

I'll find what's wrong with your project inspecting it at Demo account site.

R
rainerwolf author 5/25/2007

Hello Jane
i have publish my project in the demo account.

J
Jane 5/25/2007

Rainer,
please post URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email].