无法传递布尔值

vas*_*vas 0 html coldfusion

我有一个表单字段/复选框,即使选中它也无法传递布尔值.

 <input type="checkbox" name="IsContactValid"
               id=" IsContactValid" 
                  <cfif                        
                        ContactView.GetIsContactValid()>CHECKED
         </cfif>>
that will be transmitted to the receiving form if the box is checked.
Run Code Online (Sandbox Code Playgroud)

请帮助.

Pek*_*ica 7

您可以为复选框指定一个值:

 <input type="checkbox" name="IsContactValid" value="1"
               id=" IsContactValid" 
                  <cfif                        
                        ContactView.GetIsContactValid()>CHECKED
         </cfif>>
Run Code Online (Sandbox Code Playgroud)

如果选中此框,将传输到接收表格.