Simple if else calculation but retrieve data from another table.

smkso

New Member
Hi,

I'm going straight to the point.

I have 2 elements in a form;
  1. Field element = 'test'
  2. Calc element = 'status'
What I want to do is, when I enter a set of numbers in the test field, the status will return me a certain value. For example, when I enter an ID number, the status will verify whether the numbers entered exists in another table.

Here is my settings for the 'status' element;
Calculation;
PHP:
$student_id = '{members___student_id}';
$input_id = '{event___test}';
if ($input_id == "")
{
return "Enter Student ID";
}
else if ($input_id == $student_id)
{
return "VALID";
}
else
{
return "INVALID";
}

I set AJAX calculation to Yes. And set the AJAX observe fields to '{event___test}'.

Then I realised that {members___student_id} is from another table. Now I dont know what to do.

Help!
 
Back
Top