how to access scriptcase7 field value with {}

Dear all:

how to access the field value by {}.

For example

I have a “text” field named aaa, and a “select” field named bbb.
My plan is when I typing “999999” on field aaa
the field bbb will recieve the value “999999” and run a SQL to get a list from the database.

Qustion is , how to write the SQL statement?

my database have two tables

table_a
code_a_ID PK
code_a_name

table_b
code_b_ID PK
code_a_ID FK
code_b_name

when I wrote like this

SELECT code_b_ID,code_b_name
FROM table_b
WHERE code_a_ID = {aaa}

run and got a error message

I try to use

SELECT code_b_ID,code_b_name
FROM table_b
WHERE code_a_ID = ‘{aaa}’

same error again

So, how to get the field aaa value “999999” on SQL WHERE statement is my question

{aaa}—fail
‘{aaa}’—fail

then I try to find what the SQL recieved from field aaa
so, I adjust the field bbb type from “select” to “text” and wrote a ajax onBlur event on the field aaa

When I use {bbb}={aaa}; bbb showed same as aaa
When I use {bbb}=’{aaa}’;bbb show $this->aaa

how about your solution when you met this kind of issue?use global varible? or other kind of variable passing parameters on SQL WHERE statement?

I wish anyone who know it can share your experience and solution with me.

thanks a lot

Best regards

Create your bbb field of type select and apply the needed sql. Go to your aaa field and scroll down to the ajaxprocessing onchange and check the box. Select the field to be updated when aaa field changes (bbb). That should do it.

continue explore the text field triggle the select field

thanks for you suggestion ,I finished using the text field triggle the select field with ajax event .