Php 是否自动填充此html字段?
自动填充此字段最简单的方法是什么Php 是否自动填充此html字段?,php,html,autofill,Php,Html,Autofill,自动填充此字段最简单的方法是什么 <input type="text" name="start_price" value="<?=$item_details['start_price'];?>" size="8"></td> 像这样的东西听起来可能会解决您的问题: <?php // Whatever logic determines a "special case" stores a boolean value // into the var
<input type="text" name="start_price" value="<?=$item_details['start_price'];?>" size="8"></td>
像这样的东西听起来可能会解决您的问题:
<?php
// Whatever logic determines a "special case" stores a boolean value
// into the variable $special_case
$input_value = !$special_case ? $item_details['start_price'] : '0.00';
?>
<input type="text" name="start_price" value="<?php echo $input_value; ?>" size="8">
“…但在某些情况下…”什么情况?如果(某些情况){$autofill='0.00';}其他{$autofill=$item_details['start_price']];}
value=”“
@AlexLunix我的意思是我需要保留$item\u Details[start\u price]部分;因此,自动填充此字段的最短方法是最好的,@Juhana这将是一个很好的答案…换句话说,如何自动填充并传递0.00作为起始价格