I want if he chooses NO from Table1 he see a Table2

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
saleh
User
Posts: 470

I want if he chooses NO from Table1 he see a Table2

Post by saleh »

hello

Dropdown list for Table1 and Table2
I want if he chooses NO from Table1 he see a Table2
Table2 is hidden See only if No selected from Table1

Table1:
field :id 1 and 2
field :id_name Yes and No

Table2
field:id
field :id_name

please help
Thanks


sangnandar
User
Posts: 980

Post by sangnandar »

Looks like you don't need Table1.

Table2:
id
choose
id_name

If you only have 2 values (Yes/No) it better to use User Values on field:choose rather than a lookup into a separate Table1.
Then apply client script to expose field:id_name.
If user choose "Yes", expose id_name
else, don't expose id_name

For example, you can put this script into Edit Tag -> Client-side Events of field:choose.
{"change": function(e) {
var $row = $(this).fields();
var choose = $row["choose"].value(); // get user input value
if (choose == 1) { // run your condition
$row["id_name"].visible(true); //exposed
} else {
$row["id_name"].visible(false); // don't
}
}}


Post Reply