【发布时间】:2012-05-26 14:31:34
【问题描述】:
自动填充此字段的最简单方法是什么?
<input type="text" name="start_price" value="<?=$item_details['start_price'];?>" size="8"></td>
我需要保留 $item_details,因为它会被传递给其他代码,但在某些情况下,我想将其自动填充为 0.00 以方便我,因为我将使用 0.00 列出一些拍卖
我正在编辑一个 php 使用的模板来生成一些代码,所以理想情况下我只想对模板进行一些更改,而不必深入研究代码本身
【问题讨论】:
-
"...但在某些情况下..." 什么情况?
-
if( some case ) { $autofill = '0.00'; } else { $autofill = $item_details[ 'start_price' ]; }...value="<?php echo $autofill; ?>" -
@AlexLunix 我的意思是我需要保留它的 $item_Details[start_price] 部分;所以自动填充此字段的最短方法是最好的,
-
@Juhana 这将是一个很好的答案......
-
换句话说如何自动填充和传递 0.00 作为 start_price