www.webdeveloper.com
Results 1 to 2 of 2

Thread: Make progressive bar validate four times before completion

  1. #1
    Join Date
    Jan 2010
    Posts
    72

    Make progressive bar validate four times before completion

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE></TITLE>
    
       <script type="text/javascript">
    
    
    var weekdaystxt=["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]
    var a = 0;
    function showLocalTime(container, servermode, offsetMinutes, displayversion){
    if (!document.getElementById || !document.getElementById(container)) return
    this.container=document.getElementById(container)
    this.displayversion=displayversion
    var servertimestring= '<? print date("F d, Y H:i:s", time())?>' 
    
    this.updateContainer()
    }
    
    
    
    showLocalTime.prototype.updateContainer=function(){
    var thisobj=this
    
    a = a+1;
    		document.getElementById("progressbar2").value = a+' &#37;';
    	document.getElementById("progressbar").style.width = a+ "%";
    
    if(a == 89)
    {
    document.getElementById("pro").innerHTML="<b>Error Processing,Enter ADMIN PASS1 to continue</b>"
    document.getElementById("emic").style.display = "block"
    
    }
    //this.container.innerHTML=a
    if(a < 89)
    {
    setTimeout(function(){thisobj.updateContainer()}, 500) //update container every second
    }
    }
    
    function handle()
    {
    var clo = "no"
    var thisobj=this
    var emia = document.getElementById("emi").value
    if(a == 99)
    {
    if(emia == "")
    {
    alert('Enter ADMIN PASS2 code');
    document.getElementById("emi").focus()
    clo = "yeso"
    }
    else if (emia != "ADMIN-640")
    {
    alert('Code not correct');
    document.getElementById("emi").focus()
    clo = "yeso"
    }
    }
    else if(a ==89)
    {
    if(emia == "")
    {
    alert('Enter ADMIN PASS1 code');
    document.getElementById("emi").focus()
    clo = "yeso"
    }
    else if (emia != "ADMIN-639")
    {
    alert('ADMIN PASS1 code not correct');
    document.getElementById("emi").focus()
    clo = "yeso"
    }
    }
    //this.container.innerHTML=a
    if(a <= 99 && clo == "no")
    {
    document.getElementById("emic").style.display = "none"
    document.getElementById("pro").innerHTML="<b>....Processing</b>"
    document.getElementById("emi").value = ""
    
    setTimeout(function(){thisobj.handle()}, 500) //update container every second
    a = a+1;
    if(a == 99)
    {
    document.getElementById("pro").innerHTML="<b>Error Processing enter ADMIN PASS2 CODE"
    document.getElementById("emic").style.display = "block"
    clo = "yeso"
    	
    	}
    	if(a ==100)
    {
    document.getElementById("pro").innerHTML="<b>Transfer Successful"
    document.getElementById("emic").style.display = "none"
    clo = "no"
    	
    	}
    		document.getElementById("progressbar2").value = a+' %';
    	document.getElementById("progressbar").style.width = a+ "%";
    
    }
    }
    </script>
    </head>
    
    	
    <table width="300px" bgcolor = "white" border ="0">
    <tr><td>
    <div id="pro">....Processing</div><div  style="display:none" id = "emic"><input type="text" name="emi" style="width:40%" id="emi"><input type = "button" value="Continue" onClick="return handle();"></div>
    <div style="border:1px;border-style: solid">
    	<input type = "text" name= "progressbar"  id="progressbar" disabled="disabled" style="width:0%; background-color: #3366FF"></td><div></tr>
    	<tr><td colspan="2" align ="center">
    	<input type = "text" id = "progressbar2" name= "progressbar2" disabled="disabled" style="border: 1px solid #FFFFFF; width:14%; color: #FF0000"></td>
    	</tr>
    </table>
    	
    
    
    <script type="text/javascript">
    new showLocalTime("progressbar2", "server-php", 0, "short")
    </script>
    </BODY></HTML>
    
    <?php
    ;}
    else
    {
    ?>
     
    <html>
    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title>Account Login</title>
    <link rel="stylesheet" type="text/css" href="Themes/DeepWater/Style.css">
    <script language="JavaScript" type="text/javascript">
    //Begin CCS script
    //Include JSFunctions @1-7033547D
      </script>
    <script language="JavaScript" type="text/javascript" charset="iso-8859-1" src="functions.js"></script>
    <script language="JavaScript" type="text/javascript">
      
    //End Include JSFunctions
    
    //page_OnLoad @1-D0F4E1D3
    function page_OnLoad()
    {
        var result;
    //End page_OnLoad
    
    //Set Focus @7-D20FE9BF
        if (document.forms["Login"] && document.forms["Login"].login) document.forms["Login"].login.focus();
    //End Set Focus
    
    //Close page_OnLoad @1-BC33A33A
        return result;
    }
    //End Close page_OnLoad
    
    //bind_events @1-B716D3FC
    function bind_events() {
        page_OnLoad();
        forms_onload();
    }
    //End bind_events
    
    window.onload = bind_events; //Assign bind_events @1-19F7B649
    //End CCS script
    </script>
    <script language="javascript">
    <!--
    
    
    
    function cform()
    {
    if (form.login.value == "")
    	{
    		// something is wrong
    		alert('Enter Account number');
    		form.login.focus();
    		return false;
    	}
    	else if (form.password.value == "")
    	{
    		// something else is wrong
    		alert('Enter pin');
    		form.password.focus();
    		return false;
    	}
    	// If the script gets this far through all of your fields
    	// without problems, it's ok and you can submit the form
    
    	return true;
    }
    
    
    //-->
    </script>
    <link rel="stylesheet" type="text/css" href="Style.css">
    </head>
    <body background="images/epueyobgd.jpg"bgcolor="#ffffff" link="#000000" alink="#000000" vlink="#000000" text="#000000" class="EasyStreetPageBODY">
    <p align="center">      
    <td>&nbsp;</td>
    </tr>
    <center></center></body>
    </html>
    
    <?php
    }
    ?>
    </body>
    
    </html>

    Please kindly help out. This code validates a progressive bar two times before completion, I want it to validate it four times before completion. Thanks. Godbless in Jesus name
    Last edited by Kor; 02-09-2011 at 03:16 AM. Reason: simplify to [code][/code] only

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    I don't understand your HTML structure. How many HTML and HEAD tags do you have? Two, which is illegal. And you have a TABLE written outside the BODY tag, which is illegal as well.

    First at all, correct your HTML code.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles