Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6099949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:19:51+00:00 2026-05-23T13:19:51+00:00

I am new to javascript.Itried to make this page but somehow shorten function does

  • 0

I am new to javascript.Itried to make this page but somehow shorten function does not work on providing doctype specification.I am using this one

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

but without specifcation it works fine
following is full code of file:

<html>
<head>
<script language="javascript" >
function show(){
document.getElementById("dynamic").style.display="block";
document.getElementById("dynamic").style.opacity=1;
document.getElementById("dynamic").innerHTML="<table><tr>\n\t<td>Enter current password:</td><td><input type=\"password\" name=\"ppass\" size=\"45\"></td></tr><tr>\n<td>Enter new password:</td><td><input type=\"password\" name=\"npass1\" size=\"45\"></td></tr><tr>\n<td>Confirm password:</td><td><input type=\"password\" name=\"npass2\" size=\"45\"></td></tr><tr><td colspan=2><input type=submit value=\"Save\"></tr></table>\n";
document.setting.question[1].checked=true;
}
function hide(){
    if(document.forms.setting.question[0].checked!=true){
        fade("dynamic",50);
        }
    }
function appear(){
    document.getElementById("dynamic").style.display="block";
    document.getElementById("dynamic").style.opacity=1;
    document.getElementById("dynamic").innerHTML="<table><tr>\n\t<td>Enter password:</td><td><input type=\"password\" name=\"ppass\" size=\"45\"></td></tr><tr><td>Security Question:</td><td><input type=\"text\" name=\"ques\" size=\"100\"></td></tr><tr><td>Answer:</td><td><input type=\"password\" name=\"ans\" size=\"10\"></td></tr><tr><td colspan=2><input type=submit value=Save></tr></table>";
    document.setting.pass[1].checked=true;
    }
function disappear(){
    if(document.forms.setting.pass[1].checked){
        slide("dynamic",50);
        }
    }
function fade(id,time){
    var i=0;
    for(;i<10;i++){
        setTimeout("document.getElementById('dynamic').style.opacity-=0.1",(i*time));
        }
    i--;
    setTimeout("gayab("+id+")",(i*time));
    }
function gayab(id){
    id.style.display="none";
    id.innerHTML="";
    id.style.opacity=1;
    }
function slide(id,time){
    var i=1;
    document.getElementById(id).style.height=150;
    var b=document.getElementById(id).style.height;
    for(;i<15;i++){
        var j="shorten("+id+","+i+")";
        var k=i*time;
        setTimeout(j,k);
        }
    var j="gone("+id+")";
    var k=i*time;
    setTimeout(j,k);
    }
function shorten(id,i){
    id.style.height=(15-i)*10;
    }
function gone(id){
    id.style.display="none";
    id.style.height=150;
    }
</script>
<noscript>You are Using an Outdated Browser.<br>Please Update Your Browser</noscript>
<style>
.options{float:left;}
#dynamic{float:right;background-color:rgb(210,205,236);height:150px;opacity:1;overflow:hidden;width:720px;display:none;}
.nofloat{clear:both;}
</style>
<title>Settings</title>
</head>
<body>

<p align=right><a href=home.php>HOME</a> <a href=newpass.php>Change Password</a> <a href=logout.php>Log Out</a></p>
<form action="changepass.php" method="post" name="setting">
<div class=options>
<table>
<tr>
    <td>Change Password:</td>
    <td><input type="radio" name="pass" onClick="show();" value="1" id="Yes"><label for="Yes">Yes</label></td>
    <td><input type="radio" name="pass" onClick="hide();" value="0" id ="No" CHECKED><label for="No">No</label><br></td>
</tr>
<tr>
    <td>Change Security Question:</td>
    <td><input type="radio" name="question" onClick="appear();" value="1" id="yes"><label for="yes">Yes</label></td>
    <td><input type="radio" name="question" onClick="disappear();" value="0" id="no" CHECKED><label for="no">No</label></td>
</tr>
</table>
</div>
<div id="dynamic"></div>
<div class=nofloat>
<a href=logout.php>Logout</a>
</div>
</form>
</body>
</html>

please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:19:52+00:00Added an answer on May 23, 2026 at 1:19 pm

    Your Doctype (despite being inappropriate for the document since it don’t consist of a frameset) is triggering Standards mode.

    This is a good thing as it massively reduces inconsistency between different browsers (and between browsers and standards).

    In standards mode, most browsers will follow the CSS specification and treat things like height: 27 as an error to be ignored instead of an error to be corrected to height: 27px.

    The obvious problem with your code (there may be others, you have posted a lot of code) is that you are assigning numbers to CSS properties with JavaScript … and numbers don’t have units.

    To take just one example:

    id.style.height=150;
    

    should be:

    id.style.height = "150px";
    

    You make a similar mistake in at least one other place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I make this on multiple lines. I tried but it does not
I have found this example on StackOverflow: var people = new List<Person> { new
I found the JavaScript to break up the queryString of a page and pull
I am building Javascript application for mobile browsers (not wrapped-as-native app). I noticed that
I made this strobe light function and the strobe function worked. I've been trying
I've got this: var lDate = document.getElementById('txtLeaveDate'); var rDate = document.getElementById('txtReturnedDate'); Err...javascript so how
I have a new web app that is packaged as a WAR as part
I want to use a temp directory that will be unique to this build.
I'm getting an error here that says I haven't defined a method, but it
Here's my conundrum: I have a page that uses Google Maps V3 and jQuery.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.