Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#789289
I have a dynaform like this

User A:
Code: Select all
|-------------------|   |-------------------|   |--------|
      Name(n1)           Destination(d1)        Checkbox(c1)
|-------------------|   |-------------------|   |--------|
User B:
Code: Select all
|-------------------|   |-------------------|   |--------|
      Name(n2)           Destination(d2)        Checkbox(c2)
|-------------------|   |-------------------|   |--------|
Now I have another dynafor which will show like this based on checkbox. If I click on the Checkbox for A then only the value of A will show on another Dynaform (Named only User).

User:
Code: Select all
|-------------------|   |-------------------|
      Name(n)               Destination(d)    
|-------------------|   |-------------------|
Please give me suggestion with
Code: Select all
PHP--> Trigger
How can I pass data from User A to User or User B to User......
#789290
Hello,

In order to access the values of checkbox in second dynaform, take two hidden variables in second dynaform whose id matches the id of checkboxes from first dynaform. The javascript code for the second dynaform would be:
Code: Select all

$(document).ready(function () {
if  ($("#checkA").getValue() == '["1"]' || $("#checkA").getValue() == "1") {
          $("#nameA").show();
          $("#destinationA").show();
       }
       else {
           $("#nameA").hide();
          $("#destinationA").hide();
       }

if  ($("#checkB").getValue() == '["1"]' || $("#checkB").getValue() == "1") {
          $("#nameB").show();
          $("#destinationB").show();
       }
       else {
           $("#nameB").hide();
          $("#destinationB").hide();
       }
});
where nameA and destinationA are the id's of the UserA
nameB and destinationB are the id's of the UserB
checkA and checkB are the id's of checkboxes in the first dynaform, which are taken as hidden fields in the second dynaform.

Hope this helps, please let me know if the proposed solution worked for you.

Best Regards,
Zainab
#789298
Hello,

To achieve this using a trigger is a bit complicated.
Triggers basically work with variables rather than the fields. Javascript works on fields.
The activity of showing and hiding cannot be performed using a php code, it can be done suitably using javascript.

As an alternative you can do the following:
To show the entry of checked field in second dynaform, you need to take a grid instead of different text fields.
Consider the following steps :

1. Take a grid with the fields: type, name and dest.
2. The grid will have the rows corresponding to the entries checked in the previous dynaform.
3. Create a trigger, with the following code:
Code: Select all
$count = 0;
if(@@checkA_label == "true"){
	$count ++;
	@=grid001[$count] = array('type' => "A",
							  'name' => @=nameA,
							  'dest' => @=destA);
}
if(@@checkB_label == "true"){
	$count ++;
	@=grid001[$count] = array('type' => "B",
							  'name' => @=nameB,
							  'dest' => @=destB);
}
This will increment the count for a checked entry and add the corresponding field values to the row.

Hope this helps

Best Regards
Mishika
Zappify Consumer Report

Zappify 2.0 Review- Picture this: you're sitting o[…]

Zappify Consumer Report

Zappify 2.0 Review- Picture this: you're sitting o[…]

🚨 Verpassen Sie nicht die neueste Handelsplattform[…]

Thanks. Very useful. https://www.solarpanelinstal[…]