CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Change field value if text input in text box

Print topic Send  topic

Author Message
Dean
Posted: 11/25/2004, 2:03 AM

How can I get a form(TaskRecord) to change another fields value behind the scenes, if a user enters data in a text box in the form. ie. if the field "IS NOT NULL" change "type_id" to a value of 2
Martin K
Posted: 11/25/2004, 11:40 PM

Hello.
You can make this in Before Insert or Before Update of the Form TaskRecord.
if($TaskRecord->ie->GetValue() <> "")
$TaskRecord->type_id->SetValue(2);
elseif($TaskRecord->ie->GetValue() == "")
$TaskRecord->type_id->SetValue(1);

Martin
Dean
Posted: 11/26/2004, 9:16 AM

Thank you sooo much that works PERFECT!!

Would you please help me with one last thing.
I would like the task grid to default to show only tasks with a type_id of 2 instead of currently showing all tasks. Unless otherwise is chosen in the search grid.

Martin K
Posted: 11/26/2004, 1:59 PM

Hello.
You can make this in the search Grid.
In the DataSource you can make this:
Klick on the + for adding Where.
Name = type_id
Parameter Source = s_type_id
Type: URL
Use Default Value if parameter is empty = 2

If you search without s_type_id there will only the type_id2 Values Shown.
s_type_id = your Fieldname in the searchbox for type_id.


Sorry about my english
by martin
Dean
Posted: 11/26/2004, 9:01 PM

That works too!!

With this method there doesn't leave the option to still select ALL tasks however.
Dean
Posted: 11/27/2004, 10:18 AM

Is there a way to still searcy by ALL ?
Maybe have 0 = 1 & 2 or a 3 = 1 & 2
Martin K.
Posted: 11/27/2004, 11:26 PM

Hello.
If you use:
Default Value if parameter is empty =
in the Where, all will shown. Donīt use Default Value.

By Martin
Dean
Posted: 11/30/2004, 1:03 AM

Hi Martin,

I understand that but let me try to explain:

Example.

type_id 1=New Cars (default value/display)
type_id 2=Old Cars

From the search grid would like to be able to display All Cars type_id 1 & 2 but not by default.
Maybe type_id 3 could=All Cars
but I don't know how to do this.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright Đ 2003-2004 by UltraApps.com  and YesSoftware, Inc.