So I have created a ServerConnect that gets a list of programs that a user might have access to. There is a status column (1=On, 0=Off). In the page I have created a simple container followed by a Repeat that is linked to the serverconnect1. Within the Repeat I have a Horizontal Form Group that contains a a Radio Control. There is a radio for the On and one for the Off. Now this is the tricky part, since the Repeat is creating the radio groups dynamically when it comes time to update the database with the user’s selection, how do you process the $_POST values when the radio groups are dynamically created?
First off, I do not see a FORM element or a submit button. Secondly, the $_POSTed values come from the NAME attribute which in your example are left empty,
Ben, thanks for starting to take a look at this. You are correct, there is no FORM element or a submit button. I pulled the radio repeat out of a much larger page to figure out how to even display the radios since they very based on the data pulled from the database.
As for the NAME attribute, I see when “viewing the source code” that the field is blank. But there is also a dmx-bind:name=“id” where “id” is a value coming in from the serverconnect. When you “inspect element” in the browser for one of the radio groups you can see the actual id value in the code.
So, my concern is how to process the radios when I would submit a form since they NAME value for a radio would be different for each potential serverconnect call.
dmxAppConnect.js:7 GET https://ewlusa.org/theportal/dmxConnect/api/admin/admin_get_user_appaccess.php?app_user_id=2&app_chapter_id=1 401 (Unauthorized)
So, took your advice and added a form and submit button. The form submits to a simple PHP page that just has a var_dump of the POST variable. This results in what I expected, the values of all of the selected radios each represented by the ID of the record in the database.
Database is a MySQL table with the following columns: id, userid, appid, app_status
Form now submits. There is a hidden userid input that comes in and a multi-dimensional array that comes in. The question is how to handle the update to the database with the multidimensional array values in the server connect.
So the numbers (42, 38, 43) are IDs for rows in a database table. The “1” and “0” are status values for those numbers. Need to be able to loop through the numbers and update the values. What does this look like in the server connect? I’m not sure how to access the correct level of the array in the database query.