Page 1 of 1

Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Sun Sep 08, 2019 6:53 pm
by richvle
Hi,
I noticed that checkgroup controls get cleared out upon submission if those controls are disabled. Anybody else having this issue?

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 10, 2019 1:00 am
by amosbatto
What version of PM? manual or Bitnami installation? What OS? What version of PHP?
I want to check it.

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 10, 2019 11:46 am
by richvle
Version 3.1.1-community
Bitnami
Windows Server 2012
PHP Version 5.6.26

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 10, 2019 4:07 pm
by amosbatto
I'm not seeing the problem in PM 3.2.0 Community (manual install in Debian 9.5).

Have you tried "read-only" mode?
Is your list of options in the checkgroup populated with an SQL query?

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 10, 2019 6:57 pm
by richvle
Yep, I tried read only, and for view only, it works fine, except since I embedded a control into a subform, and that control is depended on another control that uses an event listener, it doesn't work as documented in viewtopic.php?t=710350

I just did a work around by making it view only and having the event listener in the parent form's JavaScript.

By the way, just incase, I still had the same problem with the disabled checkgroup clearing out even when it's not in a subform.
amosbatto wrote: Tue Sep 10, 2019 4:07 pm I'm not seeing the problem in PM 3.2.0 Community (manual install in Debian 9.5).

Have you tried "read-only" mode?
Is your list of options in the checkgroup populated with an SQL query?

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 17, 2019 1:56 pm
by greenhouse
Yep, I tried read only, and for view only, it works fine, except since I embedded a control into a subform, and that control is depended on another control that uses an event listener, it doesn't work as documented in viewtopic.php?t=710350

I just did a work around by making it view only and having the event listener in the parent my ip birthday wishes tneb form's JavaScript.
By the way, just incase, I still had the same problem with the disabled checkgroup clearing out even when it's not in a subform.

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Tue Sep 17, 2019 6:04 pm
by amosbatto
Are you sure that you only have one case open at a time in your web browser?
If you open a second case in the same web browser, you change the system variables, so variables won't be correctly saved when submitting a Dynaform.

If you want me to check out what is happening, you can post the .pmx file for your process, but tell me exactly which Dynaform has the problem and in which task.

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Wed Sep 18, 2019 10:57 am
by richvle
I created a new process to make it easier to look at. I narrowed it down to the javascript for a button control that's causing it. A submit control works fine, but if you use the following JavaScript, by the 3rd task the selections disappeared.
Code: Select all
$("#button0000000001").find("button").click(function()
{ 
	$("form").submitForm();
});
See the attached file.
amosbatto wrote: Tue Sep 17, 2019 6:04 pm Are you sure that you only have one case open at a time in your web browser?
If you open a second case in the same web browser, you change the system variables, so variables won't be correctly saved when submitting a Dynaform.

If you want me to check out what is happening, you can post the .pmx file for your process, but tell me exactly which Dynaform has the problem and in which task.

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Wed Sep 18, 2019 5:50 pm
by amosbatto
Make sure that you are using that code in a normal button (not a submit button).
Also, try using this code:
Code: Select all
$("#button0000000001").find("button").click(function() {
   var formId = $("form").prop("id");
   $("#"+formId).submitForm();
});
Does that change anything?

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Thu Sep 19, 2019 12:44 pm
by richvle
Correct, the code is only for the normal button control, not the submit button control.
It still has the same effect even after the change. I've also attached the updated pmx with the change your requested.
amosbatto wrote: Wed Sep 18, 2019 5:50 pm Make sure that you are using that code in a normal button (not a submit button).
Also, try using this code:
Code: Select all
$("#button0000000001").find("button").click(function() {
   var formId = $("form").prop("id");
   $("#"+formId).submitForm();
});
Does that change anything?

Re: Check Group Gets Cleared Out After Submission If The Control Is Disabled

Posted: Thu Sep 19, 2019 6:13 pm
by amosbatto
I just ran a case in your process, and I didn't observe the values in the checkgroup being deleted.
I clicked on the button (not the submit button) each time, and the values were were always saved.

I just tried it in 3.3.10 community Edition (in Debian 9.5, PHP 5.6.37, MySQL 5.7.17).
You need to upgrade, but see this before upgrading:
https://www.pmusers.com/index.php/Bugs_ ... /upgrading