This topic is locked
[SOLVED]

 Hiding fields in form based on another table

8/27/2015 5:45:56 PM
PHPRunner General questions
D
dodgebros author

I am trying to construct a project where the user can create a custom inspection form by showing only those fields they select from a master list of fields.
Table inspection_masters is where the user creates their custom inspection form by checking only those fields they want the user to see.
Table inspections is where the actual inspections are stored.
The two tables, inspection_master and inspections have the same fields.
Somehow I need to create the list of fields that are to be hidden using the function hidefield().
What is the simplest way to create the list?

Thanks,

TD

admin 8/27/2015

Store those fields in the database. Run SQL query, retrieve the list of fields to hide, loop through query result hiding fields one by one.

D
dodgebros author 8/27/2015



Store those fields in the database. Run SQL query, retrieve the list of fields to hide, loop through query result hiding fields one by one.


That is what I had planned on doing using a php script. Would my script need to connect to the database outside of PHPRunner or is there some way to do this within PHPRunner? Now the real question, how do you pass the results of the loop to Javascript since the hidefield() function has to run in the Javascript On Load event?
Thanks,

TD

admin 8/28/2015

This, of course, needs to be done in PHPRunner. Passing data from PHP event to Javascript event is possible:

http://xlinesoft.com/phprunner/docs/how_to_access_php_variables.htm
And you can also hide fields from PHP code:

http://xlinesoft.com/phprunner/docs/hidefield.htm

D
dodgebros author 8/28/2015



This, of course, needs to be done in PHPRunner. Passing data from PHP event to Javascript event is possible:

http://xlinesoft.com/phprunner/docs/how_to_access_php_variables.htm
And you can also hide fields from PHP code:

http://xlinesoft.com/phprunner/docs/hidefield.htm


OK, if all of this needs to be done within PHPRunner then how/where do I create/run the SQL statement to create the list of fields to hide?
TD

D
dodgebros author 9/1/2015



And you can also hide fields from PHP code:

http://xlinesoft.com/phprunner/docs/hidefield.htm


My bad, did not read the reply very close.
TD

[/quote]