AnsweredAssumed Answered

Nintex web form not loading preview due to adding similar javascript code

Question asked by elezama on Jul 6, 2016
Latest reply on Jul 7, 2016 by elezama

Hello,

I am new to Nintex Web Forms for sharepoint and I am running into an issue when hitting the preview button will sit on a loop and won't load the form.

 

I have created a yearly survey and I am trying to populate a Text control (ResponseText1) with the value from a hidden calculated value (jsPreviousResponse1). If the calculated value control has information,  a checkbox control will be displayed (usePrevious1) to decide if the previous answer would like to be used and if so, populate the text box.

 

The javascript below works but if I add a set of code for another question (usePreviousX, jsPreviousResponseX, ResponseTextX), the form preview enters a "please wait" loop.

 

Ideally I was thinking of having a generic function with an onclick event that will know which checkbox was clicked and grab the ID for the textbox and the calculated value controls but not sure how to do it in Nintex javascript. NWF seems to look for the specific ID name to be rendered and it's not like I could do userPrevious +"N... any suggestions are welcome.

 

Anyways, why wouldn't the preview load. Am I missing some special call for  javascript to work?

 

Thanks

 

-------------------------------------------------------

 

NWF$('#'+usePrevious1).click(function() {

      if(NWF$('#'+usePrevious1).prop('checked') == true){

         var prevres = NWF$("#"+jsPreviousResponse1).val();

         NWF$("#"+ResponseText1).val(prevres);

     }

     else{

          NWF$("#"+ResponseText1).val("");

     }  

});

 

//once this set of code is added, the preview issue happens

NWF$('#'+usePrevious2).click(function() {

      if(NWF$('#'+usePrevious2).prop('checked') == true){

         var prevres = NWF$("#"+jsPreviousResponse2).val();

         NWF$("#"+ResponseText2).val(prevres);

     }

     else{

          NWF$("#"+ResponseText2).val("");

     }  

});

Outcomes