Results 1 to 4 of 4

Thread: web form question.

  1. #1
    Pseudo-Mad Scientist Whiternoise's Avatar
    Join Date
    Apr 2006
    Location
    Surrey
    Posts
    4,274
    Thanks
    166
    Thanked
    386 times in 233 posts
    • Whiternoise's system
      • Motherboard:
      • DFI LANPARTY JR P45-T2RS
      • CPU:
      • Q6600
      • Memory:
      • 8GB DDR2
      • Storage:
      • 5.6TB Total
      • Graphics card(s):
      • HD4780
      • PSU:
      • 425W Modu82+ Enermax
      • Case:
      • Silverstone TJ08b
      • Operating System:
      • Win7 64
      • Monitor(s):
      • Dell 23" IPS
      • Internet:
      • 1Gbps Fibre Line

    web form question.

    Hey,

    what sort of code would i need to make a form field update as the user is typing in info
    example:

    field1: user enters a number
    field2: "
    field3: "

    field4: adds the results of 1, 2 and 3 and displays in realtime.

    thanks for any advice, i think there's probably a javascript solution, but i can't find one.
    Whiternoise

    EDIT: oh, and i need to make sure that it doesn't interfere with a POST command in the form.
    Last edited by Whiternoise; 22-05-2006 at 06:36 PM.

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Yea a client side scripting language quite obviously. If you're suggesting you can't find a suitable example then, well, you're not looking hard enough
    To err is human. To really foul things up ... you need a computer.

  3. #3
    listen to escape fails :) luap.h's Avatar
    Join Date
    Jan 2004
    Posts
    569
    Thanks
    4
    Thanked
    2 times in 2 posts
    you'll need to attach a javascript function so that anytime field1-3 change, field 4 is calculated

    Code:
    <input name="field1" onchange="doCalculate();" />
    
    function doCalculate()
    {
    total = document.form.field1.value + document.form.field2.value + document.form.field3.value;
    document.form.field4.value = total;
    }
    something like that

  4. #4
    Pseudo-Mad Scientist Whiternoise's Avatar
    Join Date
    Apr 2006
    Location
    Surrey
    Posts
    4,274
    Thanks
    166
    Thanked
    386 times in 233 posts
    • Whiternoise's system
      • Motherboard:
      • DFI LANPARTY JR P45-T2RS
      • CPU:
      • Q6600
      • Memory:
      • 8GB DDR2
      • Storage:
      • 5.6TB Total
      • Graphics card(s):
      • HD4780
      • PSU:
      • 425W Modu82+ Enermax
      • Case:
      • Silverstone TJ08b
      • Operating System:
      • Win7 64
      • Monitor(s):
      • Dell 23" IPS
      • Internet:
      • 1Gbps Fibre Line
    Cheers, much appreciated, and it's not that i don't look hard enough, it's just that i didn't know quite the name for the script that i was searching for (if you see what i mean )
    Last edited by Whiternoise; 09-06-2006 at 12:24 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. police application form question
    By psalliss in forum General Discussion
    Replies: 14
    Last Post: 27-06-2008, 01:50 PM
  2. Me Again, HTML Form Question This Time
    By Vini in forum Software
    Replies: 19
    Last Post: 05-10-2005, 10:57 AM
  3. Java Web server / HTTP proto question
    By Purple in forum Software
    Replies: 9
    Last Post: 13-10-2004, 10:50 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
  •