Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Euro -> text field formatting

Status
Not open for further replies.

Bramvg

IS-IT--Management
Jan 16, 2001
135
BE
Hi,

When some enters a number into a text field I would like to format (check) the entered number.

Because the format of the euro MUST be: xxxxx,xx
the first string (before the ',') can be as long as the user wants it, but before the last two numbers their must be a ','.

Example:

17897 = 178,97

Does anyone know how to do this?

With kind regards
bram
 
try this

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME=&quot;Generator&quot; CONTENT=&quot;EditPlus&quot;>
<META NAME=&quot;Author&quot; CONTENT=&quot;&quot;>
<META NAME=&quot;Keywords&quot; CONTENT=&quot;&quot;>
<META NAME=&quot;Description&quot; CONTENT=&quot;&quot;>
</HEAD>

<BODY>
<FORM METHOD=POST ACTION=&quot;&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;nirmal&quot; onkeydown=&quot;return fun(this.value)&quot;Value=&quot;&quot; Title=&quot;&quot;>
</FORM>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--
function fun(str){
if (str.charAt( str.length-3) ==','){
return false;
}
return true;
}
//-->
</SCRIPT>
</BODY>
</HTML>

Nirmal
 
Hi,


It's not working when I test it :;-(

bram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top