Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,257 Programmers. There are 2,043 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

What is next

 
Reply to this topicStart new topic

What is next

moneysspd
post 6 May, 2008 - 05:13 PM
Post #1


New D.I.C Head

*
Joined: 1 May, 2008
Posts: 6



I need ti write an interactive web page using JavaScript that will ask the user his/her month, day and year of birth (in separate prompt boxes) and displays his/her date of birth (using the month name, not number) and current age in a dialog box.

ok i have done some work but now iam stuck i don't know what to do next can some one give me a hint.
CODE

<html>
<head>
<title>Project</title>
<script type="text/javascript">

</script>
</head>
<body>
<script type="text/javascript">
var birthMonth = parseInt(prompt("Please enter the month of your birth"));
var birthDate = parseInt(prompt("Please enter the date of your birth"));
var birthYear = parseInt(prompt("Please enter the year of your birth"));    
var today = new Date()

var month = today.getMonth()
var monthText
    if(month==0)
        monthText="January"
    else
    if(month==1)
        monthText="February"
    else
    if(month==2)
        monthText="March"
    else
    if(month==3)
        monthText="April"
    else
    if(month==4)
        monthText="May"
    else
    if(month==5)
        monthText="June"
    else
    if(month==6)
        monthText="July"
    else
    if(month==7)
        monthText="August"
    else
    if(month==8)
        monthText="September"
    else
    if(month==9)
        monthText="October"
    else
    if(month==10)
        monthText="November"
    else
        monthText="December"
var date = today.getDate()
var year = today.getFullYear()
var day = today.getDay()
var dayText
    if(day==0)
        dayText="Sunday"
    else
    if(day==1)
        dayText="Monday"
    else
    if(day==2)
        dayText="Tuesday"
    else
    if(day==3)
        dayText="Wednesday"
    else
    if(day==4)
        dayText="Thursday"
    else
    if(day==5)
        dayText="Friday"
    else
        dayText="Saturday"
</script>
</body>
</html>
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


BenignDesign
post 6 May, 2008 - 07:09 PM
Post #2


D.I.C Regular

Group Icon
Joined: 28 Sep, 2007
Posts: 484

What exactly is the question? What do you want it to do next?

Also... there is no month zero. Asking someone to input a birthdate is never going to yield a 0 month (unless it's a typo).

There are some other problems I see there, too, but let's start with one question and go from there.

Also, could PLEASE stop posting and reposting the same thing? Try one thread, check replies, make your changes, check back, etc, etc... makes it easier on everyone involved. Thanks.

This post has been edited by BenignDesign: 6 May, 2008 - 07:16 PM
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:43AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month