|
Posted by BootNic on 04/01/06 17:52
> "LeftHorn" <leftnospamhorn@spameenoono.nu> wrote:
> news:442e6f6c$0$154$edfadb0f@dread11.news.tele.dk....
>
> Hi,
>
> I have a problem...Got a webpage with alot of different input
> fields - where a user can maintain a database.
>
> They are allowed to use 'spaces' in their textfields, sometimes
> they require to insert a space in the end, sometimes it would be
> fatal if they do - the problem is that from a visual point of view
> the inputfield is like this:
>
> TextColor Black
> BackGround White
>
> Nobody are able to see how many spaces there is after a string,
> unless the cursor is placed in the field - i need somehow to get a
> different TextBackgroundColor (ex. gray) then they would be able to
> locate it by sight, instead of having to manually run through all
> fields.
>
> Can this be done ? by HTML or JS or something ? hope you can help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');}
String.prototype.plus=function(){return this.trim()+' ';}
</script>
<title></title>
</head>
<body>
<!--
Form values should be checked on the server.
JavaScript should only be used to assist the user.
-->
<form action="javascript:void(this)">
<!--
Remove white space before and after value
-->
<input onchange="this.value=this.value.trim()"><br>
<!--
Remove white space before and after value then add one space to the end
-->
<input onchange="this.value=this.value.plus()">
</form>
</body>
</html>
--
BootNic Saturday, April 01, 2006 9:51 AM
It is well known that "problem avoidance" is an important part of
problem solving. Instead of solving the problem you go upstream and
alter the system so that the problem does not occur in the first
place.
*Edward de Bono*
[Back to original message]
|