2 Replies Latest reply: Sep 30, 2013 7:49 AM by user1175496 RSS

    Update Doc Info form -Showing checked checkboxes.

    user1175496
      I'm able to present the checkboxes and assign the value to metadata using the following code:

      <$if strEquals(fieldName, "xLang") and not (isInfo or isQuery)$>
      <script>
      function boxFunc()
      {
      var textval=document.getElementsByName('xLang')[0];
      var langs=document.getElementsByName("ucmlang");
      larray="";
      for(i=0;i<langs.length;i++)
      {
      if(langs.checked)
      {
      larray=larray+langs.id+",";
      }
      }
      larray=larray.substring(0,larray.length-1);
      textval.value=larray;

      }
      </script>
      <tr <$strTrimWs(inc("std_nameentry_row_attributes"))$>>
      <td<$if captionFieldWidth$>width="<$captionFieldWidth$>"<$endif$> <$if isInfo$>align=right<$endif$>><$strTrimWs(inc(fieldCaptionInclude))$></td>
      <td <$if isFieldInfoOnly$>colspan="100"<$endif$> <$if captionEntryWidth$>;width="<$captionEntryWidth$>"<$endif$>><$inc(fieldEntryInclude)$></td>
      <td><!– addition –>English<!– end addition –><input type="checkbox" name="ucmlang" id = "English" onclick="boxFunc()">
      <td><!– addition –>French<!– end addition –><input type="checkbox" name="ucmlang" id = "French" onclick="boxFunc()"></td>
      <td><!– addition –>Italian<!– end addition –><input type="checkbox" name="ucmlang" id = "Italian" onclick="boxFunc()"></td>
      <td><!– addition –>German<!– end addition –><input type="checkbox" name="ucmlang" id = "German" onclick="boxFunc()"></td>
      <td><!– addition –>Japanese<!– end addition –><input type="checkbox" name="ucmlang" id = "Japanese" onclick="boxFunc()"></td>
      </tr>
      <$else$>
      <$include super.std_nameentry_row$>
      <$endif$>

      but i'm stuck which include to modify in case of the update metadata form.
        • 1. Re: Update Doc Info form -Showing checked checkboxes.
          user434745
          Which form does that work on? Generally, the checkin & update forms will use the same includes.
          • 2. Re: Update Doc Info form -Showing checked checkboxes.
            user1175496

            Hi ,

            I 'm able to achieve it by modifying the std_nameentry_row include and adding below code:

            <html>

            <head>

            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

            <title>

            DislpayLangaugeCheckboxes htmlIncludeOrString</head>

            <body>

            <@dynamichtml std_nameentry_row@>

            <$if strEquals(fieldName, "xLanguages") and not (isInfo or isQuery)$>

            <script>function boxFunc()

            {

                var textval=document.getElementsByName('xLanguages')[0];

              var language = document.get

                    var langs=document.getElementsByName("ucmlang");

                    larray="";

                        for(i=0;i<langs.length;i++)

                      {

                         if(langs[i].checked)

                               {

                                 larray=larray+langs[i].id+",";

                               }

                  }

                      larray=larray.substring(0,larray.length-1);

                      textval.value=larray;

            }</script>

            <style type="text/css">

            table#Languages-Checkbox td{

            padding-right: 20px;

            }

            </style>

            <tr <$strTrimWs(inc("std_nameentry_row_attributes"))$>>

            <td class=" idcFieldCaption idcCheckinUpdateCaption"<$if captionFieldWidth$>width="<$captionFieldWidth$>"<$endif$> <$if isInfo$>align=right<$endif$>><$strTrimWs(inc(fieldCaptionInclude))$></td>

            <td> <table id ="Languages-Checkbox" style="white-space: nowrap;">

                <tr>

                    <td ><input type="checkbox" name="ucmlang" id = "BrazilianPortuguese" onclick="boxFunc()" style ="margin:3px" <$if (isUpdate or isEditMode) and (strIndexOf(xLanguages, "BrazilianPortuguese")>-1)$>checked=true;<$endif$>>Brasil - Português</td>

                    <td ><input type="checkbox" name="ucmlang" id = "Japanese" onclick="boxFunc()" style ="margin:3px"<$if (isUpdate or isEditMode) and (strIndexOf(xLanguages, "Japanese")>-1)$>checked=true;<$endif$>>Japan - &#26085;&#26412;(Japanese)</td>

              </tr>

              </table>

            </td>

            <td style= "visibility:hidden;"<$if isFieldInfoOnly $>colspan="4"<$endif$> <$if captionEntryWidth$>;width="<$captionEntryWidth$>"<$endif$>><$inc(fieldEntryInclude)$></td>

            </tr>

             

             

             

             

            <$else$>

            <$include super.std_nameentry_row$>

            <$endif$>

            <@end@>

            </body>

            </html>