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

  • Home
  • SEARCH
  • 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 205969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:36:13+00:00 2026-05-11T17:36:13+00:00

I have a php page and i have some javascript code to have a

  • 0

I have a php page and i have some javascript code to have a running total of some fields. i pretty well copied from a working test that i had and modified the code some to fit. well it doesn’t work and i can’t seem to work. is there something blatently obvious i’m missing or is there some other reason why it’s not running?

 <?php

 //server connection info

 ?>
 <html>
 <head>
 <title>Survey</title>
 <link rel="stylesheet" type="text/css" href="styles.css" />

       <script type="text/javascript">
           function Total()
           {

               var a=document.getElementById("a").value;
               var b=document.getElementById("b").value;
               var c=document.getElementById("c").value;
               var d=document.getElementById("d").value;

               a=parseInt(a);
               b=parseInt(b);
               c=parseInt(c);      

               var total=a+b+c;



               document.getElementById("total").value=total;


           }


       </script>


 </head>


 <body>
 <h1>QUALITY OF LABOR SURVEY</h1>
 <p />
 <h2>ABOUT YOUR COMPANY</h2>


 <div class="Wrapper">

     <form id="Main" method="post" action="Process.php">

         <div class="Question">
              1. In what state and county is your business located? (click below)
         </div>
         <div class='answer'>
         <?php
             $tsql = "select
                StateCountyID,
                State,
                County
                from dbo.StateCounty
                where State='MO'
                      and Active='True'
                order by State";

             $tsql2 = "select
                StateCountyID,
                State,
                County
                from dbo.StateCounty
                where State='IL'
                      and Active='True'
                order by State";


             /* Execute the query. */
             $stmt = sqlsrv_query( $conn, $tsql);
             if ( $stmt )
             {

                 echo "<span><select name='ListMO'>";
                 echo "<option value='0'>MO-County</option>";

                 while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC))
                 {

                     echo "<option value='".$row[0]."'>";
                     echo $row[2];
                     echo "</option>";

                 }

                 echo "</select></span>";

             }
             else
             {
                  echo "Error in statement execution.\n";
                  die( print_r( sqlsrv_errors(), true));
             }


             $stmt2 = sqlsrv_query( $conn, $tsql2);
             if ( $stmt2 )
             {

                 echo "<span><select name='ListIL'>";
                 echo "<option value='0'>IL-County</option>";

                 while( $row = sqlsrv_fetch_array( $stmt2, SQLSRV_FETCH_NUMERIC))
                 {
                     echo "<option value='".$row[0]."'>";
                     echo $row[2];
                     echo "</option>";

                 }

                 echo "</select></span>";

             }
             else
             {
                 echo "Error in statement execution.\n";
                 die( print_r( sqlsrv_errors(), true));
             }
        ?>
           </div>



         <table width="700px">
           <tr>
             <td style="font-size: 1.2em; font-weight: bold;">
                 ABOUT YOUR EMPLOYMENT
             </td>
             <td style="font-weight: bold;">
                 (Exclude Temporary Employees Throughout Survey)

             </td>
           </tr>

         </table>

         <p />
         <b>Please estimate the following:</b>







         <p />




         <div class="Question">
              4. Number of Full-Time Hourly Employees (Eligible for Full-Time Benefits)
         </div>

         <div class="Answer">
              <input type="text" id="a" value="0" onchange="Total();" />
         </div>

         <div class="Question">
              5. Number of Part-Time Hourly Employees(Not Eligible for Full-Time Benefits)
         </div>

         <div class="Answer">
              <input type="text" id="b" value="0" onchange="Total();" />
         </div>

         <div class="Question">
              6. Salaried Employees
         </div>

         <div class="Answer">
              <input type="text" id="c" value="0" onchange="Total();" />
         </div>





         <div class="Question">
              7. Is this your current number of employees?  If not, change responses to 4, 5, and 6.
         </div>

         <div class="Answer">
              <input type="text" id="total" value="0" onchange="Total();" />
         </div>
  • 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-11T17:36:13+00:00Added an answer on May 11, 2026 at 5:36 pm
    var d=document.getElementById("d").value;
    

    produces error, because you don’t seem to have element with id="d"

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

Sidebar

Ask A Question

Stats

  • Questions 197k
  • Answers 197k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Each ajax request is going to have overhead associated with… May 12, 2026 at 7:28 pm
  • Editorial Team
    Editorial Team added an answer $('#textMessage').keyup(function(event) { if (event.keyCode == 13) { var message =… May 12, 2026 at 7:28 pm
  • Editorial Team
    Editorial Team added an answer Use: SELECT t.name_id, t.last_name, a.street_address FROM NAME t JOIN ADDRESS… May 12, 2026 at 7:28 pm

Related Questions

I was just viewing stackoverflow page source and I have a few simple questions;
I have a simple form on a page and I want to auto submit
I have a page with a dropdown. The onchange event calls a Javascript function
I'm making a rating system, and I have the following jQuery code on my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.