Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apex: Validation on two dependent page items

NewApexCoderJun 28 2013 — edited Jul 8 2013


Apex 4.2

I have a  form with two separate regions that each have text fields / select list on them. I need to validate one field againt another.

**Region 1

- P10_REQUESTOR

- Select List

- LOV defenition:

SELECT first_name
FROM PERSONS
ORDER BY firs_name

I.e. you can select a first name from the select list

**Region 2

- P11_NAME

- Text Field

A regular text field to  type in the first name of a person

**Logic:

When a user navigates to this page, they can either pick a first name from the select list OR if the name is not in the list, they can type in the name in the P11_NAME text field. However, they can not do both. I am having a little trouble writing a validation script to capture these cases.

Case 1: P10_REQUESTOR is null & P11_NAME is not null

Case 2: P10_REQUESTOR is not null & P11_NAME is null

If both items are null then an error message needs to appear stating that one or the other must be filled out

If both items are not null then an error message needs to appear stating that you can only fill out one or the other

I have pseudo coded it and understand the logic but am having trouble on knowing which options to choose when creating the validation. I was thinking its somewhere along the lines of a PL/SQL function with a few IF statments in it.

Any help would be greatly appreciated. Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2013
Added on Jun 28 2013
5 comments
2,062 views