Changing SPFieldMultiChoice style on display form

Forums Dynamic Forms for SharePoint Changing SPFieldMultiChoice style on display form

Viewing 2 reply threads
  • Author
    Posts
    • #32089
      Paul Lynch
      Participant

      Multi choice fields (SPFieldMultiChoice) look terrible in display form (just a basic array separated by a semicolon ;)..

      Choice 1;Choice 2;Choice 3

      I know JSON can do it in a list view, is there a way to at least separate them into a new line in the Display form?

      Choice 1
      Choice 2
      Choice 3

    • #32091
      Alexander Bautz
      Keymaster

      You can straighten it up by using this code:

      function fixMultichoiceDisplay(fin){
          var p = jQuery("#dffs_"+fin+" td.ms-formbody")
          p.html(p.text().split("; ").join("<br>"));
      }
      // Use it like this
      fixMultichoiceDisplay("Your_Field_Internal_Name");

      Alexander

    • #32093
      Paul Lynch
      Participant

      Awesome just what I wanted thanks

      • This reply was modified 1 month, 3 weeks ago by Paul Lynch.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.