0

I have an infopath form in which there is a multiple selection list box , lets call this form 'v1' .

Now there is a new requirement and I need to change these multiple selection check box to separate Check Boxes so that I also have the unchecked event for the check boxes which was not available for the list box.

So I changed the form accordingly and published the new form with the changes (form 'v2').

Now the problem is that when the old forms in the library, created using form v1, are opened it will be using template of form v2 and the list box becomes disabled and the new check boxes are not shown.

Is it possible to somehow alter the list box into multiple check boxes such that the old forms will render them as multiple checkboxes instead of showing the disabled old form.

Or is it possible to set the old infopath forms to be opened in the v1 template and new forms to use the v2 template.

Any help or suggestion is much appreciated. Thanks

EDIT

We are required to complete this without any managed code.

1

Using content types can help with this. Publish V1 as a content type, set the library to use content types, set V1 as the default content type, relink all your existing forms.

Then, publish V2 as a content type. Set V2 as the default content type. All new forms will use the V2 template, old forms will continue to use V1.

  • the Infopath form was directly published to the library, will publishing the form as content type now cause any issues to the existing the forms in the library. Also After publishing V2 should we relink the documents again? – mallu coder Aug 18 '16 at 8:36
  • I believe if you change the library to use content types, the existing forms will still point to the template that was published to the library (so your v1 template). Then you can publish v2 as a content type, and if you have any forms that are supposed to be using v2, you can relink just those. You should also consider testing all this - set up a test library and try some of the things I'm talking about there. Then you'll be more confident making changes in the library where you need to make a change. – hilary Aug 19 '16 at 15:03
0

You would have to include some JavaScript into your InfoPath form in order to convert each list item that is selected into a checked box. But I'm not sure what kind of impact that would have when trying to save the form back to the server.

You can find instructions on how to add jQuery in InfoPath forms outlined here: http://riteshudupak.blogspot.com/2010/09/add-jquery-to-browser-enabled-infopath.html

Your jQuery could look something like this:

$("SELECTOR FOR WHERE TO APPEND").append("<div id='newOptionsWrapper'></div>");

$("#multiListSelection li:selected").each(function(){
     var nameOfSelectedLI = $(this).prop("name"); //or change this to value
     $("#newOptionsWrapper").append("<input type='checkbox' value="+nameOfSelectedLI+">"+nameOfSelectedLI +"<br>");
});
  • This sounds great but unfortunately i cannot use managed code in my template – mallu coder Aug 18 '16 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.