Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 显示单选按钮和选中复选框的mpdf_Php_Pdf_Checkbox_Mpdf - Fatal编程技术网

Php 显示单选按钮和选中复选框的mpdf

Php 显示单选按钮和选中复选框的mpdf,php,pdf,checkbox,mpdf,Php,Pdf,Checkbox,Mpdf,我有一个简短的问题 我在用户单击按钮时创建pdf输出。然而,我的问题是收音机和复选框。我尝试使用标准 ($answer=='What value's')?'选中“:” 但是,当输出到pdf时,它不会显示单选按钮或选中的复选框。有没有办法在pdf输出中选择单选按钮或复选框 谢谢试试这个: if ($answer = "1"){ $output .= 'Yes <input type="checkbox" checked /> '; } else{ $output .= 'Yes

我有一个简短的问题

我在用户单击按钮时创建pdf输出。然而,我的问题是收音机和复选框。我尝试使用标准
($answer=='What value's')?'选中“:”

但是,当输出到pdf时,它不会显示单选按钮或选中的复选框。有没有办法在pdf输出中选择单选按钮或复选框

谢谢

试试这个:

if ($answer = "1"){

 $output .= 'Yes <input type="checkbox" checked /> ';
}
else{
 $output .= 'Yes <input type="checkbox" /> ';
}
if($answer=“1”){
$output.='Yes';
}
否则{
$output.='Yes';
}
其中1是真的。我假设,您从db获得这些值。在此循环中,如果选中,请检查这些值。

尝试以下操作:

if ($answer = "1"){

 $output .= 'Yes <input type="checkbox" checked /> ';
}
else{
 $output .= 'Yes <input type="checkbox" /> ';
}
if($answer=“1”){
$output.='Yes';
}
否则{
$output.='Yes';
}

其中1是真的。我假设,您从db获得这些值。在这个循环中,如果检查了,请检查这些值。

好的,我找到了解决方案。我所做的是将复选框和单选按钮放在if语句中,并将代码放在以下格式中:

<input type="radio" checked="checked"> Yes

那就成功了

好的,我找到了解决办法。我所做的是将复选框和单选按钮放在if语句中,并将代码放在以下格式中:

<input type="radio" checked="checked"> Yes

那就成功了

是的,这是正确的,它来自数据库。我要试一试。。谢谢。是的,这是正确的,它来自数据库。我要试一试。。非常感谢。不会工作的,应该是,谢谢。谢谢。你节省了我的时间。同样,选择的属性应该是
显示
不起作用,应该是,谢谢。谢谢。你节省了我的时间。以同样的方式,所选属性应该是
Display