Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

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.
User avatar
By groakes
#793980
Hi,

I am having a problem with a setonchange function for a suggest control in a Dynaform.

I have a radio button (additionalCuratorRequired) which, when selected, should show a suggest control (additionalCurator) which executes an SQL query to get a list of users in the Group "Curators"
Code: Select all
select USERS.USR_UID, USR_USERNAME from USERS, GROUP_USER, GROUPWF where USR_USERNAME <> '' and USERS.USR_UID = GROUP_USER.USR_UID and GROUP_USER.GRP_UID = GROUPWF.GRP_UID and GRP_TITLE = 'Curators';
However, when I preview the form it fails to load - I just get the spinning circle.
Code: Select all
function showOrHideAdditionalCurator() {
  if ($("#additionalCuratorRequired").getValue() == 1 ) {
        $("#additionalCurator").show();
      } else {
        $("#additionalCurator").hide();
  }
}

showOrHideAdditionalCurator();
$("#additionalCuratorRequired").setOnChange(showOrHideAdditionalCurator);
I have other setonchange controls that work on this form - I have included the full form as an attachment.

When I comment out the execution line the form loads fine (though obviously the suggest control doesn't appear).
I have replaced the SQL query with a set of options and that hasn't made any difference.
I have also replaced the suggest field with a text field, again to no success.

Any ideas? Is there something I have missed (standard comment here about me not being a programmer)?

thanks
Greg
Attachments
(26.05 KiB) Downloaded 107 times
#794004
groakes wrote: $("#additionalCuratorRequired").setOnChange(showOrHideAdditionalCurator);[/code]
You used setOnChange (note the capital letters on 'On' and 'Change') while the function should be setOnchange (note that only 'On' has a capital letter)

See the javascript functions here: http://wiki.processmaker.com/3.0/JavaSc ... etOnchange

Hope that helps, I had the same problem when I started working on my process

Hi, What version of the program are you using? […]

HI Programerboy, Thank you for your advice. I am[…]

Adding CurrentDate to Case Label

Hi, Please check the following link: http://pmlea[…]

How to categories inbox cases

I dont quite know the answer to you question, but […]