This topic is locked

How to set default values and dropdown

6/12/2007 12:34:00 PM
PHPRunner General questions
stanl author

I am having difficulty getting this to work. Any help is greatly

appreciated.
I have a user table that has the fields username and areaid
username areaid

stanl 1

ksouth 2

.

.

.

etc.
I have a request table that has areaid, customer, problem
areaid customer problem

1 john need computer

1 joe need network

2 sue word document problem

.

.

.

etc.
When user stanl signs on for areaid 1, how do I set the default value for areaid to 1

and likewise areaid 2 when ksouth signs on for area2? I do not want the user to have to pick their area
area 1 does not see area 2 records and vice versa
In addition I have a dropdown for building that is tied to the area, so when area 1 is signed on

you only see buildings for area 1. The table is simply building and areaid. How do I populate this

using the areaid of the user signed on so I only get building for their area?
Thanks

Sergey Kornilov admin 6/12/2007

You need to choose "Users can see and edit their own data only" security mode and choose AreaID is an OwnerID field.
Also you can add a WHERE clause to drodown box to filter records:

" areaid = " . $_SESSION["OwnerID"]
stanl author 6/12/2007

You need to choose "Users can see and edit their own data only" security mode and choose AreaID is an OwnerID field.

Also you can add a WHERE clause to drodown box to filter records:

" areaid = " . $_SESSION["OwnerID"]


Thanks so much!
I must have done this a couple of hundred times and didn't realize I had a default value set elsewhere. From version 3 to 4 if you have the field hidden, it can sometimes get forgotten. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=18830&image=1&table=forumreplies' class='bbc_emoticon' alt=':huh:' />

J
Jane 6/13/2007

Hi,
to remove field from the add page just uncheck this field on the Choose fields tab in the PHPRunner.