Calcultions on HTML!!!?

i need to calculate stuff and display them on an HTML page..

that is add up two details entered by the user and display the answer in te third space.....

I know VB pretty well..

how can i put them both together...

or is there any other method??

3 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    I'd suggest javascript instead, it's self-contained, requiring only a browser. Here's how you can calculate user input:

    <html>

    <head>

    <script type="text/javascript">

    function calculate(){

    v1 = document.getElementById("v1");

    v2 = document.getElementById("v2");

    v1 = v1.value;

    v2 = v2.value;

    v1 = v1 * 1;

    v2 = v2 * 1;

    var res = v1 + v2;

    alert(res);

    }

    </script>

    </head>

    <body>

    <form onsubmit="calculate()">

    value 1: <input type="text" id="v1" size="20"><br />

    value 2: <input type="text" id="v2" size="20"><br />

    <br />

    <input type="submit" value="Submit">

    </form>

    </body>

    </html>

  • 1 decade ago

    darling try this link

    http://www.google.co.uk/search?hl=en&sa=X&oi=spell...

    you say you are good with VB then use vb scripts

    here is Example for VB script

    <html>

    <body>

    <script type="text/vbscript">

    document.write("Hello from VBScript!")

    </script>

    </body>

    </html>

    now use your skills and write that function in vb then INCLUDE YOUR CODE LIKE THIS

    <html>

    <body>

    <script type=YOUR FUCTION

    ========

    </script>

    </body>

    </html>

    NOW LETS SEE IF YOU CAN DO IT HONEY

  • Anonymous
    1 decade ago

    You would need some kind of script for that. Learn what your web server will support, then learn that. php, perl, vba.... any of those

    Good luck and Happy Computing!

Still have questions? Get your answers by asking now.