Jump to content

djbuddhi

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Posts posted by djbuddhi

  1. u don't have to write much

     

    one of my project sample

     

     

    function ajaxFunction(){

    var ajaxRequest;  // The variable that makes Ajax possible!

     

     

    try{

    // Opera 8.0+, Firefox, Safari

    ajaxRequest = new XMLHttpRequest();

    } catch (e){

    // Internet Explorer Browsers

    try{

    ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

    try{

    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");

    } catch (e){

     

    alert("Your browser broke..!Pls Try Again ...!");

    return false;

    }

    }

    }

    // Create a function that will receive data sent from the server

    ajaxRequest.onreadystatechange = function(){

    if(ajaxRequest.readyState == 4){

    var ajaxDisplay = document.getElementById('divAdd_Info');

    ajaxDisplay.innerHTML = ajaxRequest.responseText;

    }

    }

     

     

          var password  = document.getElementById("password").value;

          var new_password = document.getElementById("new_password").value;

              var re_password  = document.getElementById("re_enter_password").value;

     

         

                  if(password==""){

     

    alert("Current Password Cannot be Blank..!");

    document.getElementById("password").select();

    document.getElementById("password").focus();

        return false;

            }

     

     

    if(new_password==""){

     

    alert("New Password Cannot be Blank..!");

    document.getElementById("new_password").select();

    document.getElementById("new_password").focus();

        return false;

            }

     

              if(re_password==""){

     

    alert("Re Enter Password Cannot be Blank..!");

    document.getElementById("re_enter_password").select();

    document.getElementById("re_enter_password").focus();

        return false;

            }

     

     

                if(password==new_password){

     

    alert("Current Passsword & New Password cannot be The Same ...!");

    document.getElementById("re_enter_password").select();

    document.getElementById("re_enter_password").focus();

        return false;

            } 

     

     

     

     

     

     

                if(re_password!=new_password){

     

    alert("New Passsword Does not match with the Re-Enter Password ..!");

    document.getElementById("re_enter_password").select();

    document.getElementById("re_enter_password").focus();

        return false;

            } 

     

              /*

      if (password == "") {

      //hide_error();

      document.getElementById("nameError").style.display = "inline";

      document.getElementById("password").select();

      document.getElementById("password").focus();

          return false;

      }

     

      else

        if(new_password=="") {

      hide_error();

      document.getElementById("new_pass_Error").style.display = "inline";

      document.getElementById("new_password").select();

      document.getElementById("new_password").focus();

          return false;

      }

     

      else

        if(re_password=="") {

      // hide_error();

      document.getElementById("re_enter_password").style.display = "inline";

      document.getElementById("re_enter_password").select();

      document.getElementById("re_enter_password").focus();

          return false;

      }

    else{

    document.getElementById("re_enter_password").style.display = "none";

     

    }

     

     

                      function  hide_error(){

        document.getElementById("nameError").style.display = "none";

    document.getElementById("new_pass_Error").style.display = "none";

        document.getElementById("re_enter_password").style.display = "none";

      }

      */

     

      //  noOfSubmits++;

     

    //if(noOfSubmits>1)

    //{

    //alert("Submission already done. Please wait ..!");

    //return false;

    //}

     

    //else{

     

     

     

     

     

    var queryString = "?current_pass="+password +"&new_password="+new_password  +"&re_enter_password="+re_password;

     

     

    ajaxRequest.open("POST", "change_password_approver.php" + queryString, true);

    ajaxRequest.send(null);

    //}

    }

     

     

  2. i want to generate this fomula

     

    value =(a*b)/100

     

    for the first month

    a                b              value      total

     

    5800            2                116      5800+116

     

    for the second month

    5916            2                118.32  5800+116+118.32

     

    how to write this using above sql .i am still have a doubt of doing it

  3. my database field as two columns a ,b

     

    SELECT (a+(a*b))  AS now_total  FROM table_name

     

    let say in mathematics (a+(a*b))=x

     

    this is working fine .my question is next time when performing the sql the calculation must be performed to x* (a*b)

     

    the query must execute like that .how to write in SQL

    ex:

    a    b      x

    2    5        12

    12  5        72

     

    the flow is like this .who 2 write the query

                 

     

     

     

  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>

    <title>Untitled Document</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <script type="text/javascript">

      function sumAll_1() {

          var reslultEID = document.getElementById("reslult");

          reslultEID.value = parseFloat(document.getElementById("t1").value);

      }

     

      function sumAll_2() {

          var reslultEID = document.getElementById("reslult");

          reslultEID.value = parseFloat(document.getElementById("t1").value) + parseFloat(document.getElementById("t2").value);

      }

    </script>

    </head>

     

    <body >

    <form name="form1" method="post" action="">

      <p> </p>

      <p> </p>

      <p> </p>

      <p> </p>

      <p> </p>

      <table width="316" border="1" align="center">

        <tr>

          <td width="140">Num1</td>

          <td width="160"><input type="text" name="t1" id="t1" onKeyUp="sumAll_1();" onChange="sumAll_2();" ></td>

        </tr>

        <tr>

          <td>Num2</td>

          <td><input type="text" name="t2" id="t2" onKeyUp="sumAll_2();" ></td>

        </tr>

        <tr>

          <td>Result</td>

          <td><input type="text" name="reslult" id="reslult"></td>

        </tr>

      </table>

      <p> </p>

    </form>

    </body>

    </html>

     

  5. <html>

    <head>

    <title>.:I 0wn U:.</title>

    <script language="JavaScript">

    <!--

    window.onbeforeunload = bunload;

     

    function bunload(){

    dontleave="Are you sure you want to leave?";

    return dontleave;

    }

    //-->

    </script>

    </head>

    <body>

    Please stay on this page!

    </body>

    </html>

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.