0
我需要填写的字段应重新填充正确填写的字段,而不要提交表单并为错误填写的字段提供错误。什么是最好的方式来做到这一点?如何在验证通过之前重新填充字段?
请注意,使用此代码,我正在重新填充字段,因为它们应该在提交表单时正确显示,并且在重新加载页面时它们都会显示。
<div class="dropdown_structure">
<?php
if($user['location'] == "empty")
{
echo country_dropdown('location');
}
else
{
echo country_dropdown('location',$user['location']);
}
?>
</div>
另请注意,我已经尝试在输入字段中插入值。
$data = array('name' => 'location', 'value' => $this->input->post('location'));
echo relation_dropdown('location');
在此先感谢