www.webdeveloper.com
Results 1 to 3 of 3

Thread: Javascript alert box with buttons?

  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Javascript alert box with buttons?

    Hi, I'm working on a website project for my XHTML class. I enjoy the HTML and CCS part of the course, but cannot stand javascript. I just don't understand it. This is an elective, I'm not a CS major/minor, just taking the class for fun to build on what I learned in high school. The last few assignments I've had have all dealt with javascript and I've managed to get by but I don't understand it. We've been working on a website all year adding in new techniques from what we've learned all year. The final project requires a working script, but that's not my question. My website is about weimaraners (I own two and I couldn't really think of anything else to make the site about). My script is going to ask the user if they have a dog, and if they do I'm going to have a window alert asking how old the dog is, and my function will output their dog's age in "dog-years." My question has to do with the first if statement. Would someone please explain as elementary as they can (or help me with the actual coding) on how to put Yes/No buttons on the first window alert. Thanks a ton, and please answer with haste seeing how I only have two days left to turn in the final website. Thanks once again, sanfor01.

  2. #2
    Join Date
    Dec 2010
    Posts
    2
    Another thing I forgot to ask, is if someone would help me with the coding for this formula for calculating dog years?

    The formula is: 10.5 dog years per human year for the first 2 years, then 4 dog years per human year for each year after.

  3. #3
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Perhaps the easiest, but not exactly what you require, is a confirm dialog

    As for the 'dog years', the formula is simple maths and hardly different in JavaScript.

    We will help you further, but you must make an attempt to code it yourself.
    Show your code if it does not work.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

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

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



Recent Articles