Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 





Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
Thread Tools
Old 06-09-2008, 05:25 AM   #1 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 2
OS: unix, linux


Why my javascript is not working in FireFox, Help pls

Hi guys, I am trying to get my javascript working in Firefox. I dont know why it is not working in firefox but it works fine on IE and other.

here is my code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Welcome to the Pairwise Biological Sequence Alignment Web Page</title>
</head>

<body>
<h1>Welcome to the Pairwise Biological Sequence Alignment Web Page</h1>



<form action="./cgi-bin/Form.cgi" method="post">


<script type="text/javascript">
/* <![CDATA[ */
function disable()
{
document.getElementById("GapPenalty").disabled=true
document.getElementById("LinearD").disabled=true
document.getElementById("AffineD").disabled=true
document.getElementById("AffineE").disabled=true
document.getElementById("email").disabled=truea
}
function enable()
{
document.getElementById("GapPenalty").disabled=false
document.getElementById("LinearD").disabled=false
document.getElementById("AffineD").disabled=false
document.getElementById("AffineE").disabled=false
document.getElementById("email").disabled=false
}
function disable2(what)
{
document.getElementById(what).disabled = true;
}
function setupper(myfield)
{
if (myfield.inchange)return;
myfield.inchange=true;
myfield.value=myfield.value.toUpperCase();
myfield.inchange=false;
document.getElementById("LinearD").disabled=true
}
function alertMsg(what)
{
if (what == "Affine")
{

document.getElementById("LinearD").disabled=true;
(document.getElementById("LinearD").value)="";

document.getElementById("AffineD").disabled=false;
document.getElementById("AffineE").disabled=false;
}
else if (what == "Linear")
{

document.getElementById("LinearD").disabled=false;
(document.getElementById("AffineD").value)="";
(document.getElementById("AffineE").value)="";
document.getElementById("AffineD").disabled=true;
document.getElementById("AffineE").disabled=true;
}


}
function checkNum(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==13) || (key==27) )
return true;
// numbers
else if ((("0123456789").indexOf(keychar) &gt; -1)) //original ("0123456789") has zero

return true;

// decimal point jump
else if (dec &amp;&amp; (keychar == "."))
{
myfield.form.elements[dec].focus();
return false;
}
else
return false;
}
function checkLinearD(linearD){
if (linearD &gt; 10 ){
alert("Please input a number between 1-10");
(document.getElementById("LinearD").value)="";
(document.getElementById("AffineD").value)="";
(document.getElementById("AffineE").value)="";
}

}

function checkAffineD(AffineD){
if (AffineD &gt; 12 ){
alert("Please input a number between 1-12");
(document.getElementById("LinearD").value)="";
(document.getElementById("AffineD").value)="";
(document.getElementById("AffineE").value)="";
}


}

function checkAffineE(AffineE){
if (AffineE &gt; 10 ){
alert("Please input a number between 1-10");
(document.getElementById("LinearD").value)="";
(document.getElementById("AffineE").value)="";
}

}

function checkScore(Score){
if (Score &gt; 99 ){
alert("Please input a number between 1-99");
(document.getElementById("Score").value)="";
}

}

/* ]]> */
</script>




<select onclick="alertMsg(this.value)" onchange="alertMsg(this.value)" name="GapPenalty">
<option value="Linear">Linear</option>
<option value="Affine">Affine</option></select><br />
Linear d (1 - 10)=
<input type="text" onchange="checkLinearD(this.value)" onkeypress="return checkNum(this, event)" maxlength="2" size="2" name="LinearD" /><br />
Affine d (1 - 12)=
<input type="text" disabled="disabled" onchange="checkAffineD(this.value)" onkeypress="return checkNum(this, event)" maxlength="2" size="2" name="AffineD" /><br />
Affine e (1 - 10)=
<input type="text" disabled="disabled" onchange="checkAffineE(this.value)" onkeypress="return checkNum(this, event)" maxlength="2" size="2" name="AffineE" />


<br />
<br />

<br />
<br /><input type="submit" name="Submit" /><input type="reset" value="Clear Your Entries" size="4" /><input type="button" value="Refresh" onclick="history.go(0)" /><br />
</p>
</form>
</body>

</html>


Please let me know why it is not working. It suppose to work when I choose affine, the Affine D and Affine E text box will be enable.
sniperx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 06-10-2008, 06:42 PM   #2 (permalink)
Registered User
 
Join Date: Jun 2008
Location: California
Posts: 2
OS: Mac OS X


Send a message via Yahoo to omega113
Re: Why my javascript is not working in FireFox, Help pls

I would suggest you to use alert statement in your javascript code in top-to-bottom fashion. THis way it would be easy for you to track where you are going wrong.

Else i would recommend you to use firebug
https://addons.mozilla.org/en-US/firefox/addon/1843

-ANuj
http://*********

Last edited by koala : 06-11-2008 at 12:39 PM. Reason: removed spam
omega113 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 06-12-2008, 04:40 PM   #3 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 3
OS: XP


Re: Why my javascript is not working in FireFox, Help pls

1. Open Firefox

2. Go To Tools

3. Go To Options

4. Click On Contents

5. Check the box that says Enable Javascript.
TriChip is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 06-13-2008, 03:53 AM   #4 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 2
OS: unix, linux


Re: Why my javascript is not working in FireFox, Help pls

Its ok now, I had it fixed. But I had to rewrite all the javascript from scratch because xhtml takes a tougher standard and syntax than html.

And Firebug would be your best friend if you are stuck like me, however I although I got it working on Firefox. Now my code is not working for IE. So this is great!! isn't it?

My range check function is not working
sniperx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Reply


Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -7. The time now is 09:43 PM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82