maxxxx 0 Newbie Poster

Hello all, I have a big question for you all and hope you can help me. I have this web site that I took over, but did not build. This site was built with people with vision impairments in mind. When ever I do updates to the site, I have to make sure I copy them into three folders. now this is a pain for me. is there away to fix this with out rebuilding this site? One other question is. There are three contrast to pick from and thats what we want. However if you are on a link and you change the contrast. the site defaults back to the home page, and that I do not want. I hope some one can give me some input on this. Here is the site.

http://www.aacwinnipeg.mb.ca/

Thanks for your time and reading this long message.

maxxxx 0 Newbie Poster

So I would put the URL: in the ID place?

maxxxx 0 Newbie Poster

I'm getting an error in line 13 and don't know why. Can someone help me please?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script language="JavaScript">

 

function popUp(URL) {

eval("page" + id + " = window.open(URL, '" + id + "', '

toolbar=1,

scrollbars=1,

location=1,

statusbar=1,

menubar=1,

resizable=1,

width=500,

height=500,

left = 390,

top = 150');");

}

</script>




</head>

<body>

<form>

<input type=button value="Open Popup" onClick="javascript:popUp('www.rrc.mb.ca')">

</form>


</body>
</html>
maxxxx 0 Newbie Poster

I have this alert box that I would like to add a sound after you click ok. Can this be done to the script I have here?

Thanks

//<![CDATA[
var alertmessage="Well this the last and finale Assignment for the JavaScript Level One Course"

//Alert only once per browser session (0=no, 1=yes)
var once_per_session=1

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function alertornot(){
if (get_cookie('alerted')==''){
loadalert()
document.cookie="alerted=yes"
}
}

function loadalert(){
alert(alertmessage)
}

if (once_per_session==0)
loadalert()
else
alertornot()

    //]]>
maxxxx 0 Newbie Poster

I'm looking for javascript of a bird flying across my screen, is there such thing? or maybe an airplane.

Thanks.

maxxxx 0 Newbie Poster

Hello simplypixie, I solved all my problems with my menu,except I just noticed that after I have been to any of the other pages and try to return to the home page. It will not. I tryed many ways to fix it and nothing, I even added a second home tab and that worked but it looks funny with two home links.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english"> 
<meta http-equiv="Content-Style-Type" content="text/css">

<title>Welcome to my Home Page</title>

<script language="JavaScript" type="text/javascript">

////This script is for the drop down menu. The source for this  script came from [url]http://allwebco-templates.com/support/S_menus_dropdown.htm////[/url]
//-->starts here.
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->Ends here.

</script>

<td height="20" colspan="2" valign="top" bordercolor="#DDEEFF" bgcolor="#B5CBDB"><div align="center">
	<font face="Arial" color="#000080" size="3">		
	
	
<script language="JavaScript" type="text/javascript">
/// The JS below is for the date and time. and i got the sorce from [url]http://www.re-es.org/[/url] ///

//-->Starts here

var day_names = new Array(7)
day_names[0] = "Sunday"
day_names[1] = "Monday"
day_names[2] = "Tuesday"
day_names[3] = "Wednesday"
day_names[4] = "Thursday"
day_names[5] = "Friday"
day_names[6] = "Saturday"
 
 
var month_names = new Array(12)
month_names[0] = "January"
month_names[1] = "February"
month_names[2] = "March"
month_names[3] = "April"
month_names[4] = "May"
month_names[5] = "June"
month_names[6] = "July"
month_names[7] = "August" …
maxxxx 0 Newbie Poster

I'm guessing your saying in my CSS sheet. I looked and theres no ul #nav. There is the following in my CSS sheet. and in my HTML body there's nothing like that all. I'm starting to think. I'm missing some code.

#nav {
    float:left;
    width:320px;
    padding:0;
    margin:0;
    list-style-type:none;
	background-color: 
 }
#nav a {
    display:block;
    line-height:36px;
    padding-left:10px;
    color:#000;
 }
maxxxx 0 Newbie Poster

I tryed that and my drop down menu stays white.

maxxxx 0 Newbie Poster

I have a drop down menu on my page, and I want to change the background color of the box from white to match the rest of the page, how do I do this.

Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english"> 
<meta http-equiv="Content-Style-Type" content="text/css">

<title>Welcome to my Home Page</title>

<script language="JavaScript" type="text/javascript">

////The source for this  script came from http://allwebco-templates.com/support/S_menus_dropdown.htm////
///For the Game,I changed the back ground picture. I realize it's not JS///
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->




<!--
/// The JS below is for the date and time. and i got the sorce from http://www.re-es.org/ ///

var day_names = new Array(7)
day_names[0] = "Sunday"
day_names[1] = "Monday"
day_names[2] = "Tuesday"
day_names[3] = "Wednesday"
day_names[4] = "Thursday"
day_names[5] = "Friday"
day_names[6] = "Saturday"
 
 
var month_names = new Array(12)
month_names[0] = "January"
month_names[1] = "February"
month_names[2] = "March"
month_names[3] = "April"
month_names[4] = "May"
month_names[5] = "June"
month_names[6] = "July"
month_names[7] = "August"
month_names[8] = "September"
month_names[9] = "October"
month_names[10] = "November"
month_names[11] = "December"
 
 
date_now = new Date()
 
 
day_value = date_now.getDay()
date_text = day_names[day_value]
 
 
month_value = date_now.getMonth()
date_text += " " + month_names[month_value]
 
 
date_text += " " + date_now.getDate()
 
 
date_text += …
maxxxx 0 Newbie Poster

Is there away to make javascript drop down menu with out CSS? i have 5 page website I would like to change my menu to.

maxxxx 0 Newbie Poster

I have a website that is 5 pages. Is there away I can link them useing javascript. instead of the old way?

Thanks in advance.

maxxxx 0 Newbie Poster

Hello all. I'm trying to figure out the javascript so that when I hit the total up order button, it will fill in the subtotal, PST, GST and give me my total in the box above the total up order button. Can some help me out?

Thanks in advance.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
 <script type="text/javascript">


function formValidator(){

    var firstName = document.getElementById('firstname').value;
    if (firstName == "") {
        document.getElementById('firstAl').innerHTML = "first name not entered";

    }
    else {
        document.getElementById('firstAl').innerHTML = "";

    }
	
   var lastName = document.getElementById('lastname').value;
   if (lastName == ""){
     document.getElementById('secondAl').innerHTML = "last name not entered";
    }
	 else {
        document.getElementById('secondAl').innerHTML = "";

    }
	
   var streetNumber = document.getElementById('streetnumber').value;
   if (streetNumber == ""){
     document.getElementById('thirdAl').innerHTML = "street number not entered";
    }
	 else {
        document.getElementById('thirdAl').innerHTML = "";

    }
	
   var streetName = document.getElementById('streetname').value;
   if (streetName == ""){
     document.getElementById('forthAl').innerHTML = "street name not entered";
    }
	 else {
        document.getElementById('forthAl').innerHTML = "";

    }
	
	var city = document.getElementById('city').value;
   if (city == ""){
     document.getElementById('fifthAl').innerHTML = "city name not entered";
    }
	 else {
        document.getElementById('fifthAl').innerHTML = "";

    }
	
   var postalCode = document.getElementById('postalcode').value;
   if (postalCode == ""){
      document.getElementById('sixthAl').innerHTML = "postel code not entered";
    }
	 else {
        document.getElementById('sixthAl').innerHTML = "";

    }
	
   var phoneNumbera = document.getElementById('phonenumbera').value;
   if (phoneNumbera == ""){
     document.getElementById('seventhAl').innerHTML = "phone number not entered";
    }
	 else {
        document.getElementById('seventhAl').innerHTML = "";

    }
	
   var phoneNumberb = document.getElementById('phonenumberb').value;
   if (phoneNumberb == ""){
    document.getElementById('seventhAl').innerHTML = "phone number not entered";
    }
	 else {
        document.getElementById('seventhAl').innerHTML = "";

    }
	
   var email = document.getElementById('email').value; …
maxxxx 0 Newbie Poster

I have this function that seems not to be working. If I click on the send order button and the first name field is not filled, it should say first name not entered. But it's not. I put comment in the javascript where I'm tring to fix.

Thanks in advance.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
 <script type="text/javascript">


function formValidator(){
/// this var is not working and don't know why
    var firstName = document.getElementById('firstname').value;
    if (firstName == "") {
        document.getElementById('firstAl').innerHTML = "first name not entered";

    }
    else {
        document.getElementById('firstAl').innerHTML = "";

    }
	
	
//pay no attention to script below//	
	
   var lastName = document.getElementById('lastname').value;
   if (lastName == ""){
     alert("last name not entered");
    }
   var streetNumber = document.getElementById('streetnumber').value;
   if (streetNumber == ""){
     alert("street number not entered");
    }
   var streetname = document.getElementById('streetname').value;
   if (streetNamme == ""){
     alert("street name not entered");
    }
   var city = document.getElementById('city').value;
   if (city == ""){
     alert("city name not entered");
    }
   var postalCode = document.getElementById('postalcode').value;
   if (postalCode == ""){
     alert("postal code not entered");
    }
   var phoneNumbera = document.getElementById('phonenumbera').value;
   if (phoneNumbera == ""){
     alert("phone number not entered");
    }
   var phoneNumberb = document.getElementById('phonenumberb').value;
   if (phoneNumberb == ""){
     alert("phone number not entered");
    }
   var email = document.getElementById('email').value;
   if (email == ""){
     alert("email not entered");
    }
   var submit = document.getElementById('submit').value;
    }

  function comments()
 {
 (document.getElementById("comments").value);
 }
//// next step of javascript to work on after
 function addTotal() {
     document.getElementById("hamSub").value = 2.99 * document.getElementById("hamQuant").value;
               

 }

  function howtoget(){

var …
maxxxx 0 Newbie Poster

Can I add an alert to this JavaScript?

<script type="text/javascript">

document.getElementById('send').reset();

</script>

<body>

<input type="button" id="send" value="send order"/>

</body>

maxxxx 0 Newbie Poster

ddymacek would it be hard for me to change the price option to one price only and let the customer type in there own quantity?

maxxxx 0 Newbie Poster

Thank you very much. This very helpful. Thanks again.

mind you, I did not do the whole form, I did hamburger and cheeseburger fields along with subtotal pst, gst, and total fields near the end.
You were very vague on what you wanted so... I didn't quite understand until I was already coding, anyway, this should be a very good start for you.
If you want to move the 'total order' to the button, move the action to your submit button and call calculate_amount() there. hope the helps...

<script type="text/javascript">
	function calculate_amount() {
		var subtotal = 0;
		var hamburger_subtotal = 0;
		var hamburger = document.myform.hamburger.value;
		var hamburger_qty = document.myform.hamburger_qty.value;
		var cheeseburger_subtotal = 0;
		var cheeseburger = document.myform.cheeseburger.value;
		var cheeseburger_qty = document.myform.cheeseburger_qty.value;		
		var pst = 0;
		var gst = 0;
		var total = 0;
		//etc...
		//var chicken_burger;
		//var fries;
		//var gravy;
		//var chili;
		if (hamburger > 0) {
			hamburger_subtotal = hamburger * hamburger_qty;			
		}
		subtotal = hamburger_subtotal;
		// myform -- depends on the name of your actual form, if it does not have one give it one.
		document.myform.display_hamburger_subtotal.value = hamburger_subtotal;
		if (cheeseburger > 0) {
			cheeseburger_subtotal = cheeseburger * cheeseburger_qty;
		}
		// myform -- depends on the name of your actual form, if it does not have one give it one.
		document.myform.display_cheeseburger_subtotal.value = cheeseburger_subtotal;		
		subtotal = subtotal + cheeseburger_subtotal;
		pst = .07 * subtotal;
		gst = .05 * subtotal;
		// you cannot add the values after you call toFixed, so do the total now!
		total = subtotal + pst …
maxxxx 0 Newbie Poster

ok, give me a few minutes.

Thank you very much:)

maxxxx 0 Newbie Poster

what do you mean adding javascript to the hamburger quantity and price? do you need to total the values of items selected? you still have not explained what you are trying to do...?

for example if the hamburger is 2.99 and he enters 1 in the quantity field it will tell him it's 2.99 in the sub-total field. If he types 2 in the quantity field it will give him the sup--total of 2 hamburgers in the sub-total field.

maxxxx 0 Newbie Poster

No, as you have not explained what the problem is.

I'm looking for help with the first item. Then I will understand the rest. For example Adding javascript to the hamburger Quantity and price. I realize I have a hard time explaining myself.

maxxxx 0 Newbie Poster

I have this form, and I want to add JS to it. I got part of it. But the hard part is the ordering menu part it's self. Can someone help me please?

</p></td><td width="359" align="right"><table width="325">
<tbody>
<tr>
<th width="144">item</th>
<th width="75">price</th>
<th width="92">quantity</th>
<th width="101">sub-total</th>
</tr>
<tr align="middle">
<td align="left">Hamberger</td>
<td><input size="7" </td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
<tr align="middle">
<td align="left">Cheeseburger</td>
<td><input size="7" value="$3.99" /></td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
<tr align="middle">
<td align="left">Chicken Burger</td>
<td><input size="7" value="$4.99" /></td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
</tbody>
</table>
<table width="324">
<tbody>
<tr>
<th width="124">item</th>
<th width="42">price</th>
<th width="72">quantity</th>
<th width="74">sub-total</th>
</tr>
<tr align="middle">
<td align="left">French Fries</td>
<td><input size="7" value="$2.99" /></td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
<tr align="middle">
<td align="left"><input type="checkbox" />
gravy</td>
<td><input size="7" value="$0.50" /></td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
<tr align="middle">
<td align="left"><input type="checkbox" />
chilli</td>
<td><input size="7" value="$1.99" /></td>
<td><input size="3" /></td>
<td><input size="10" /></td>
</tr>
</tbody>
</table>
<table align="right">
<tbody>
<tr>
<td>subtotal</td>
<td><input size="10" /></td>
</tr>
<tr>
<td>pst 7%</td>
<td><input size="6" /></td>
</tr>
<tr>
<td>gst  5%</td>
<td><input size="6" /></td>
</tr>
<tr>
<td>total</td>
<td><input size="10" /></td>
</tr>
<tr>
<td colspan="2"><input type="button" value="total up order" />
</td>
</tr>
</tbody>
</table></td>