Results 1 to 2 of 2

Thread: processing form input values

  1. #1
    Junior Member
    Join Date
    Jun 2003
    Posts
    9

    processing form input values

    im making a form and im using the London Perl Mongers form processing script for processing...however im having trouble. basicaly what i want to do is have the user input some numbers in some fields and just sum those values and print them in another field (or in another page generated when the form is submitted...whichever is easiest)...can anyone help me? how can i go about doing this...i dont have much knowledge in cgi/perl...anyone have an easy way to get around this? thanks
    \"High on the waves you make for us...but not since you left have the waves come...\"
    -deftones

  2. #2
    Webius Designerous Indiginous
    Join Date
    Mar 2002
    Location
    South Florida
    Posts
    1,123
    This can be done in virtually any server side scripting out there. You can also do this using javascript which is done in the broswer side itself. Using javascript i would do this:


    (its late.. bear with me)

    <html>
    <head>

    <script type="text/javascript">
    function validate()
    {
    var answer
    answer = document.myForm.firstNum.value + document.myForm.secondNum.value
    document.myForm.answer.value = answer
    }
    </script>
    </head>

    <body>
    <form name="myForm" action="file.html" onsubmit="return validate()">

    Enter the first number:
    <input type="text" name="firstNum">
    Enter the second number:
    <input type="text" name="secondNum">
    <br>
    Your answer is:
    <script type="text/javascript">

    document.write(answer)
    </script>
    <input type="text" name="">
    <input type="submit" value="Send input">
    </form>

    </body>
    </html>


    Something like that should do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •