0

如何在选择列表中有复选框?该列表是由一些 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 "..."
}
4

1 回答 1

0
    {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 "..."
    }
于 2013-08-19T21:06:27.890 回答