-
HTML Form
Hi.
I have a form with 400 inputs. In this inputs, I use java too calkulate spent hours in a project. In this script I cant use "," so I have too use ".". So when i type EX."7,5" the output in the Sum box says "NaN". Is there a way too make every typed "," too "."?
Code:
<script type="text/javascript">
function startCalc(){
interval = setInterval("calc()",1);
}
function calc(){
ntid1 = document.kjorebok.ntid1.value;
ntid2 = document.kjorebok.ntid2.value;
document.kjorebok.Sumntid.value = (ntid1 * 1) + (ntid2 * 1);
}
function stopCalc(){
clearInterval(interval);
}
// End -->
</script>
<FORM name="kjorebok" method="POST">
<input type="text" name="ntid1" size="1" onFocus="startCalc();" onBlur="stopCalc();">
<input type="text" name="ntid2" size="1" onFocus="startCalc();" onBlur="stopCalc();">
<input type="text" name="Sumntid">
</form>
Best reguards
André
-
In javascript I have used the Replace function with pattern matching. Here I'm just replacing "Jones" with a space, thereby returning only the first name "Tom".
FullName = "Tom Jones";
FirstName = FullName.replace(/Jones/gi, "");
Maybe you can do the same thing with ".".
Good luck,
Bob
Similar Threads
-
By Thaxton Mauzy in forum XML
Replies: 3
Last Post: 05-28-2006, 08:59 AM
-
Replies: 2
Last Post: 04-21-2005, 11:39 AM
-
By John A Grandy in forum .NET
Replies: 0
Last Post: 07-06-2002, 10:39 PM
-
By Simon Jessop in forum ASP.NET
Replies: 0
Last Post: 01-13-2002, 12:11 PM
-
By Dean Rossi in forum Architecture and Design
Replies: 1
Last Post: 07-18-2001, 03:28 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks