[英]Input type hidden dosent hide in form when the value is larger in php
I am trying to setup hidden input field value to an xml string which is obtained from an array . 我试图将隐藏的输入字段值设置为从数组获取的xml字符串。 But the
hidden
field value is displayed in html
while when i put a normal text as value in the hidden field it works fine. 但是,当我在隐藏字段中输入普通文本作为值时,
hidden
字段值以html
显示。
//a large sized associative array convert to xml and set as hidden field
$item_array=array();
$xml=new SimpleXMLElement('<OriginDestinationOption/>');
array_walk_recursive($item_array,array($xml,'addChild'));
echo '<input type="hidden" name="return-xml" value="'.$xml->asXML();.'" />'; ?>
But it displays the value in html form.Whats wrong with my code? 但是它以html形式显示值。我的代码有什么问题?
Note:I am using codeigniter framewrok 注意:我正在使用codeigniter framewrok
The data will be overflowing the input. 数据将溢出输入。 Try to add css to input as "overflow:hidden"
尝试将CSS添加为“ overflow:hidden”
尝试这个
echo '<input type="hidden" style="display:none;" name="return-xml" value="'.str_replace('"',"'",$xml->asXML());.'" />'; ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.