Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2013, 08:17 PM
alexpilot alexpilot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 alexpilot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 49 sec
Reputation Power: 0
Need some Help with my program

Hey guys,
I have a simple assignment that I cant figure out 1 section. Im puzzled as to why my code does not work. It will not open the appropriate page. This is the following assignment.

Design a web page where the user is asked to enter the age of the target consumer.
Code:
Original - Code
    The user is then directed to a new window with the age-appropriate web page to continue the purchasing process.
After populating the form, the invoice will be displayed.


The part that i highlighted im having issues with. I got the invoice to work on the other pages. The problem Im having is that when i submit after entering age nada happens. Im lost.

Here is my code.
Thanks

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ordert</title>
</head>
<link rel="stylesheet" href="style.css">

<!-- Site navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="about_us.html">About US</a>
<li><a href="order.html">Order</a>
</ul>

<!-- Site navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="about_us.html">About US</a>
<li><a href="order.html">Order</a>
</ul>


<script type = "text/javascript">
var age_order = 0;
var total = 0;


function finish() {

var myage = document.getElementById("age");
var number = myage.value;

if (number < 5 ) {
document.write("Please Enter Your Age)
return false;
if (number < 5 || number > 10) {
"window.open('kids.html')"
return false;
}
if (10 < number < 15) {
"window.open('teens.html')"
return false;
}
else if (number > 15) {
"window.open('adults.html')"
return false;
}
}

</script>
</head>

<h3> Order Form </h3>
<p>We focus on making the right choice for you based on your age. Please fill in the following window which will take you to the correct age group page. This will allow you to pick the right product.</p>

<form name = "" onSubmit = "finish()">
<p>Please enter Your Age <input type = "text" id = "age" size = "8" /> </p>
</p>
<p><input type = "reset" name = "reset" />
<input type = "submit" name = "submit" value="Submit" /></p>
</form>


<script type = "text/javascript">

document.getElementById("age").onchange = ageHandler;


</script>
<p style="color: red; margin-left: 10px; text-align: center;">Copyright 2013 </p>


</body>
</html>

Reply With Quote
  #2  
Old February 5th, 2013, 10:01 PM
alexpilot alexpilot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 alexpilot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 49 sec
Reputation Power: 0
Quote:
Originally Posted by alexpilot
Hey guys,
I have a simple assignment that I cant figure out 1 section. Im puzzled as to why my code does not work. It will not open the appropriate page. This is the following assignment.

Design a web page where the user is asked to enter the age of the target consumer.
Code:
Original - Code
    The user is then directed to a new window with the age-appropriate web page to continue the purchasing process.
After populating the form, the invoice will be displayed.


The part that i highlighted im having issues with. I got the invoice to work on the other pages. The problem Im having is that when i submit after entering age nada happens. Im lost.

Here is my code.
Thanks

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ordert</title>
</head>
<link rel="stylesheet" href="style.css">

<!-- Site navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="about_us.html">About US</a>
<li><a href="order.html">Order</a>
</ul>

<!-- Site navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="about_us.html">About US</a>
<li><a href="order.html">Order</a>
</ul>


<script type = "text/javascript">
var age_order = 0;
var total = 0;


function finish() {

var myage = document.getElementById("age");
var number = myage.value;

if (number < 5 ) {
document.write("Please Enter Your Age)
return false;
if (number < 5 || number > 10) {
"window.open('kids.html')"
return false;
}
if (10 < number < 15) {
"window.open('teens.html')"
return false;
}
else if (number > 15) {
"window.open('adults.html')"
return false;
}
}

</script>
</head>

<h3> Order Form </h3>
<p>We focus on making the right choice for you based on your age. Please fill in the following window which will take you to the correct age group page. This will allow you to pick the right product.</p>

<form name = "" onSubmit = "finish()">
<p>Please enter Your Age <input type = "text" id = "age" size = "8" /> </p>
</p>
<p><input type = "reset" name = "reset" />
<input type = "submit" name = "submit" value="Submit" /></p>
</form>


<script type = "text/javascript">

document.getElementById("age").onchange = ageHandler;


</script>
<p style="color: red; margin-left: 10px; text-align: center;">Copyright 2013 </p>


</body>
</html>


Never mind please Close this. Stupid me forgot the brackets and some quotation marks. All fixed and works

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Need some Help with my program

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap