This little problem is nested in a php function (that means it still counts on this forum, right? 😃 )
The question actually has do do with a java input box here's the code in question:
print(" <td valign=\"center\" bgcolor=\"#$CellColor\" align=\"left\"><div class=\"BlackSmall\" align=\"left\"><input\n");
print(" type=\"hidden\" value=\"$Item^$ItemDescription^$ItemPrice\" name=\"item_$Item\"><input\n");
print(" id=\"FormsEditField$Item\" class=\"BlackSmall\" maxLength=\"3\" size=\"2\" value=\"0\" name=\"op1_$Item\" onfocus=\"value=''\"> $ItemUnit<font color=\"#ff0000\">*</font><br></div>\n");
print(" </td>\n");
Basicly it creates three cells in a table based on data returned in a mysql query. Here's what it looks like processed (hand-formatted to look pretty):
<td valign="center" bgcolor="#ffffff" align="center"><div
class="BlackSmallBold" align="center">350020ERL<br></div>
</td>
<td valign="center" bgcolor="#ffffff" align="center"><div
class="BlackSmallBold" align="center">$25.60<br></div>
</td>
<td valign="center" bgcolor="#ffffff" align="left"><div
class="BlackSmall" align="left"><input
type="hidden"
value="350020ERL^-20 Pro-Lite 350 Hose Bulk^25.60"
name="item_350020ERL"><input
id="FormsEditField350020ERL" class="BlackSmall"
maxLength="3" size="2" value="0" name="op1_350020ERL"
onfocus="value=''"> ft.<br></div>
</td>
Now, I know this is a little thing but when someone clicks on the input box, the box defaults to blank (by design).
Problem is when the box looses focus it stays blank if nothing is entered.
Anyone know a way to detect if a value is entered, and if not enter a "0" when the box looses focus?
maybe adding something like this to the input tag?
onlostfocus="if value='' then value='0' "