HTML Form


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: HTML Form

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    4

    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é

  2. #2
    Join Date
    Dec 2005
    Posts
    17
    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

  1. XML Schema -> HTML Form
    By Thaxton Mauzy in forum XML
    Replies: 3
    Last Post: 05-28-2006, 09:59 AM
  2. JSP Input/output to html form
    By CCinATL in forum Java
    Replies: 2
    Last Post: 04-21-2005, 12:39 PM
  3. web form html view incomplete
    By John A Grandy in forum .NET
    Replies: 0
    Last Post: 07-06-2002, 11:39 PM
  4. ASP entry form - output to html??
    By Simon Jessop in forum ASP.NET
    Replies: 0
    Last Post: 01-13-2002, 01:11 PM
  5. HTML Form Element Limits
    By Dean Rossi in forum Architecture and Design
    Replies: 1
    Last Post: 07-18-2001, 04: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center