Html 选择列表中的复选框

Html 选择列表中的复选框,html,list,select,checkbox,xquery,Html,List,Select,Checkbox,Xquery,如何在选择列表中设置复选框?这个列表是由一些xquery代码生成的,这使得它有点复杂。我正在努力弄清楚如何在这里使用“输入”标签 {if( $workcount > 1 ) then <form name="bentform" action="{$g:blakeroot}archive/comparison.xq" onSubmit="return mySubmit()" target="comparison"> <input name="selection" type=

如何在选择列表中设置复选框?这个列表是由一些xquery代码生成的,这使得它有点复杂。我正在努力弄清楚如何在这里使用“输入”标签

{if( $workcount > 1 )
then
<form name="bentform" action="{$g:blakeroot}archive/comparison.xq" onSubmit="return mySubmit()" target="comparison">
<input name="selection" type="submit" value="Compare" onClick="document.bentform.target='BentWin'"/>
<br/><br/>  
<select name="copies" multiple="multiple" size="3" >
<option selected="yes" value="all">All Copies and *Versions from Other Works*</option>
{for $copies in collection($g:collection)/bad[starts-with(@id , $workid)]/@id
let $bad := collection($g:collection)/bad[@id = $copies]
let $copyversion := string($bad/@copy), 
  $comporder := $bad[@id = $copies]//compdate[1]/@value, 
  $printorder :=$bad[@id = $copies]//printdate[1]/@value, 
  $printdate := $bad[@id = $copies]//printdate[1]/@value,
  $repository := $bad//repository/institution/text(),
  $repcount := count($repository)
 order by ($bad//compdate)[1]/@value, ($bad//printdate)[1]/@value, g:copydesignation($copies)
return 
if ($copies != $copyid)
then
<option value="{$copies}"><striptags>{if(exists($copyversion))then <wrap>{$copyversion}, </wrap>else ""} {string(substring-before( $printdate, '.' ))} ({if($repcount = 1) then $repository else <wrap>Multiple ({$repcount}) Institutions</wrap> })</striptags></option>
else if ( $compwith != "" ) then 
<p>If this worked, I'd be comparing this plate with {$compwith}</p>
else "..."
}
{if($workcount>1)
然后


其他作品的所有副本和*版本* {对于集合中的$copies($g:collection)/bad[以(@id,$workid)开头]/@id let$bad:=集合($g:collection)/bad[@id=$copies] 让$copyversion:=字符串($bad/@copy), $comporder:=$bad[@id=$copies]//compdate[1]/@value, $printorder:=$bad[@id=$copies]//printdate[1]/@value, $printdate:=$bad[@id=$copies]//printdate[1]/@value, $repository:=$bad//repository/institution/text(), $repcount:=count($repository) 订购人($bad//compdate)[1]/@value,($bad//printdate)[1]/@value,g:COPYDESIGNTATION($copies) 返回 如果($copies!=$copyid) 然后 {if(exists($copyversion))则{$copyversion},else”“}{string(在($printdate,'..'))之前的子字符串)}({if($repcount=1)则$repository else多个({$repcount})机构}) 否则如果($compwith!=“”),则 如果这样做有效,我会将这个盘子与{$compwith}进行比较

否则,“…” }
{if($workcount>1)
然后


其他作品的所有副本和*版本* {对于集合中的$copies($g:collection)/bad[以(@id,$workid)开头]/@id let$bad:=集合($g:collection)/bad[@id=$copies] 让$copyversion:=字符串($bad/@copy), $comporder:=$bad[@id=$copies]//compdate[1]/@value, $printorder:=$bad[@id=$copies]//printdate[1]/@value, $printdate:=$bad[@id=$copies]//printdate[1]/@value, $repository:=$bad//repository/institution/text(), $repcount:=count($repository) 订购人($bad//compdate)[1]/@value,($bad//printdate)[1]/@value,g:COPYDESIGNTATION($copies) 返回 如果($copies!=$copyid) 然后 {if(exists($copyversion))则{$copyversion},else”“}{string(在($printdate,'..'))之前的子字符串)}({if($repcount=1)则$repository else多个({$repcount})机构}) 否则如果($compwith!=“”),则 如果这样做有效,我会将这个盘子与{$compwith}进行比较

否则,“…” }
谢谢。但是我在这一行遇到了一个错误:{if(exists($copyversion))然后{$copyversion},else”“}{string(在($printdate,'.'))之前的子字符串({if($repcount=1)然后$repository else Multiple({$repcount})Institutions})解析错误:元素名包含空格:应为“else”,在第227行第82列找到“for”。在排除该解析错误后,我尝试了您的代码。结果是这些项不再位于表单框中。它应该如下所示:
    {if( $workcount > 1 )
    then
    <form name="bentform" action="{$g:blakeroot}archive/comparison.xq" onSubmit="return mySubmit()" target="comparison">
    <input name="selection" type="submit" value="Compare" onClick="document.bentform.target='BentWin'"/>
    <br/><br/>  
    <input type="checkbox" name="copies[]" value="all" id="all" /><label for="all">All Copies and *Versions from Other Works*</label>
    {for $copies in collection($g:collection)/bad[starts-with(@id , $workid)]/@id
    let $bad := collection($g:collection)/bad[@id = $copies]
    let $copyversion := string($bad/@copy), 
      $comporder := $bad[@id = $copies]//compdate[1]/@value, 
      $printorder :=$bad[@id = $copies]//printdate[1]/@value, 
      $printdate := $bad[@id = $copies]//printdate[1]/@value,
      $repository := $bad//repository/institution/text(),
      $repcount := count($repository)
     order by ($bad//compdate)[1]/@value, ($bad//printdate)[1]/@value, g:copydesignation($copies)
    return 
    if ($copies != $copyid)
    then
    <input type="checkbox" name="copies[]" value="{$copies}" id="{$copies}" /><label for="{$copies}"><striptags>{if(exists($copyversion))then <wrap>{$copyversion}, </wrap>else ""} {string(substring-before( $printdate, '.' ))} ({if($repcount = 1) then $repository else <wrap>Multiple ({$repcount}) Institutions</wrap> })</striptags></label>
    else if ( $compwith != "" ) then 
    <p>If this worked, I'd be comparing this plate with {$compwith}</p>
    else "..."
    }