Javascript form with math and plus button thing question

Discussion in 'Software' started by izzysanime, Apr 16, 2007.

  1. izzysanime

    izzysanime Private E-2

    Hi,

    Does anyone know of a tutorial or can paste code on how to make 2 or more form fields act as a calculator type of thing and give a total in another field

    Ie: form 1 = 700, and form 2 = 700, make form field 3 take those and display 1400. Does that make sense?

    Also, how do i make JS dynamically create form fields by clicking on a button. I have form fields 1,2,3, but I wont to create a button that would create another 1,2,3 form fields under those when needed. Like adding a second phone number or a third phone number but only when needed. Does that question make sense?

    Thanks
    Josh
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    This sounds like a homework question, so I won't post code, but I can point you to an EXCELLENT resource. I've never found better web development tutorials than on http://www.w3schools.com.

    This link will take you directly to their javascript tutorials. From there you can access specific information on mathematical functions, and writing code to the document. This should cover both your questions.
     
  3. izzysanime

    izzysanime Private E-2

    actually, it is not a HW question. I never took a JS class but I try to learn some once and a while, I'm more of a backend PHP kind of person. I have seen those things done and wanted to see a tutuorial on how to make those happen. The W3Schools is nice, but I was hoping for a tutorial or something.

    Thanks
    Josh
     
  4. Mada_Milty

    Mada_Milty MajorGeek

    confused
    I thought tutorials was all w3schools did.

    Oh well.

    Javascript is stored in plain text in the document's source. If there's a particular technique you're interested in, you can always view source. IMO, you'll learn more going through w3schools, though. They'll give you all the building blocks to make great techniques.
     
  5. izzysanime

    izzysanime Private E-2

    w3schools does tutorials, but not for everything.
    I know about viewing source and all, but I found a tutorial online though.

    Thanks for you help

    Josh
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds