I want to allow the user to select multiple options for one metadata,and we need to provide check boxes for the same.I have modified the respective include and added the java script ,but some how the value is not getting assigned to the metadata: I have modified the include and added JS as follows ,but the metadata is not getting assigned the selected values,can any one tell me where am I going wrong:
<script type="text/javascript">
function getSelected(Language) {
var selected = new Array();
var index = 0; for (var intLoop=0; intLoop < Language.length; intLoop++) {
if (Language[intLoop].selected) { index = selected.length;
selected[index] = new Object;
selected[index].value = Language[intLoop].value;
selected[index].index = intLoop; } }
return selected;
}
function submit(selected)
{
var value =selected;
xTranslateTo = value;
}
</script>
<$if strEquals(fieldName, "xTranslateTo") and not (isInfo or isQuery)$>
<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)$>
<INPUT TYPE=CHECKBOX NAME="Language" VALUE="English">English
<INPUT TYPE=CHECKBOX NAME="Language" VALUE="Italian">Italian
<INPUT TYPE=CHECKBOX NAME="Language" VALUE="French">French
<INPUT TYPE=CHECKBOX NAME="Language" VALUE="German" >German</td>
</tr>
<a href="javascript:;" onclick=" getSelected()">
<$else$>
<$include super.std_nameentry_row$>
<$endif$>
Can any one throw some light on where am I going wrong
I'm able to display check boxes and assign comma separated value to the metadata,now all i'm left to do is to display the checked boxes when the user calls for update metadata form.
<$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[i].checked)
{
larray=larray+langs[i].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$>