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 8346403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:00:15+00:00 2026-06-09T07:00:15+00:00

THis is my project , i have to select the section , then acording

  • 0

THis is my project , i have to select the section , then acording to that , if its “A” then checkbox from 1 50 will be displayed , and if its “B” then from 51 to 100

this is my main code :

<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
<script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function(){
    new JsDatePick({
        useMode:2,
        target:"inputField",
        dateFormat:"%d-%M-%Y"
    });
};
</script>
</head>
<?php
$dept =$_COOKIE[dept];
include_once("../Include/connectdb.php");
include_once("../Include/data_menu.php");
include_once '../Include/pagemaker.php';

?>
<script type="text/javascript">
$(document).ready(function()
{
$(".batch").change(function()
{
var id=$(this).val();
var dataString = 'year_join='+ id;

$.ajax
({
type: "POST",
url: "ajax_subject.php",
data: dataString,
cache: false,
success: function(html)
{
$(".subject").html(html);
} 
});

});
});
</script>





<script type="text/javascript">
$(document).ready(function()
{
    $(".section").change(function()
    {
        alert('asdfa');
        var id=$(this).val();
        var dataString = 'section='+ id;

        $.ajax
        ({
                type: "POST",
                url: "ajax_absent.php",
                data: dataString,
                cache: false,
                success: function(html)
                {
                    $(".absent").html(html);
                } 
        });

    });
});
</script>
</head>

<body>
<fieldset class="cbox"><legend>New Attendence System</legend>
<form name="frm" action=<?php print "edit_attendencePHP_NEW.php"; ?> method="GET"    
id="content">
<br><br>

<div style="margin:80px">
<label>Batch :</label> <select name="batch" class="batch">
<option selected="selected">--Select Batch--</option>
<?php
    $result = mysql_query("select distinct year_joining from student_profile  
order by year_joining ")or die(mysql_error());

while($year = mysql_fetch_assoc($result)){
if($year[year_joining]!="" && $year[year_joining]>"2008"){

  print "<OPTION value='$year[year_joining]'>$dept $year[year_joining]</OPTION>";
}  }
 ?>
</select>

<label>Section :</label> 
<select name="section" class="section">
        <OPTION value='A'> A</OPTION>
        <OPTION value='B'> B</OPTION>
</select>

  Date :<input type="text" size="12" id="inputField" name="date"/>

  <label>Hours :</label> <select name="hour" >
        <OPTION value='1'> 1</OPTION>
        <OPTION value='1'> 2</OPTION>
        <OPTION value='1'> 3</OPTION>

</select>
</br></br>
<label>Subject :</label> <select name="subject" class="subject">
<option selected="selected">------------Choose Subject------------</option>

  </select>
 </br>
    <label>Mark the Absenties : </label> 
    <input type="checkbox" class="section">
  <br/></br>
  <div class="absent"></div>

            <input class="bluebutton" type="submit" value="Go">    
</form><br>

<label class="comment">select a batch frm the list and press "Go"</label>
</fieldset>


</body>
</html>

This is my ajax_absent.php which is working fine separately ..

<?php
include_once("../Include/connectdb.php");


if($_POST['section'])
{
$sec=$_POST['section'];
if($sec=="A")
    $j=1;
else if($sec=="B")
    $j=51;

    for($i=0;$i<=49;$i++)
        { $k=$j+$i;
        if($i%5==0)
        {   echo "</br>";       }   
            echo '<input type ="Checkbox" value="'.$i . '">'.$k .   
 '</option>';

        }



?>

the same dynamic concept i implemented for drop down menu .. in the same file , but the check box is coming with just one check box.

  • 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-06-09T07:00:16+00:00Added an answer on June 9, 2026 at 7:00 am

    I have found some error:-

    you have user below code in jquery

    $(".section").change(function()
    

    but section class missing in

    <select name="section" >
    

    replace

    <select name="section" class="section">
    

    one more bug in your code

    you want to store output in absent class and u have use this code in jquery

    $(".absent").html(html); 
    

    but absent class not exist in your html code please add in your code

    <span class="absent"></span> 
    

    or

    <span class="absent"></span> 
    

    try this

    this is modify html code

    <html>
    <head>
    <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
    <script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript">
    window.onload = function(){
        new JsDatePick({
            useMode:2,
            target:"inputField",
            dateFormat:"%d-%M-%Y"
        });
    };
    </script>
    </head>
    <?php
    $dept =$_COOKIE[dept];
    include_once("../Include/connectdb.php");
    include_once("../Include/data_menu.php");
    include_once '../Include/pagemaker.php';
    
    ?>
    <script type="text/javascript">
    $(document).ready(function()
    {
    $(".batch").change(function()
    {
    var id=$(this).val();
    var dataString = 'year_join='+ id;
    
    $.ajax
    ({
    type: "POST",
    url: "ajax_subject.php",
    data: dataString,
    cache: false,
    success: function(html)
    {
    $(".subject").html(html);
    } 
    });
    
    });
    });
    </script>
    
    
    
    
    
    <script type="text/javascript">
    $(document).ready(function()
    {
        $(".section").change(function()
        {
            alert('asdfa');
            var id=$(this).val();
            var dataString = 'section='+ id;
    
            $.ajax
            ({
                    type: "POST",
                    url: "ajax_absent.php",
                    data: dataString,
                    cache: false,
                    success: function(html)
                    {
                        $(".absent").html(html);
                    } 
            });
    
        });
    });
    </script>
    </head>
    
    <body>
    <fieldset class="cbox"><legend>New Attendence System</legend>
    <form name="frm" action=<?php print "edit_attendencePHP_NEW.php"; ?> method="GET"    
    id="content">
    <br><br>
    
    <div style="margin:80px">
    
    <label>Section :</label> 
    <select name="section" class="section">
            <OPTION value='A'> A</OPTION>
            <OPTION value='B'> B</OPTION>
    </select>
    
      Date :<input type="text" size="12" id="inputField" name="date"/>
    
      <label>Hours :</label> <select name="hour" >
            <OPTION value='1'> 1</OPTION>
            <OPTION value='1'> 2</OPTION>
            <OPTION value='1'> 3</OPTION>
    
    </select>
    </br></br>
    <label>Subject :</label> <select name="subject" class="subject">
    <option selected="selected">------------Choose Subject------------</option>
    
      </select>
     </br>
        <label>Mark the Absenties : </label> 
        <input type="checkbox" class="section">
      <br/></br>
      <div class="absent"></div>
    
                <input class="bluebutton" type="submit" value="Go">    
    </form><br>
    
    <label class="comment">select a batch frm the list and press "Go"</label>
    </fieldset>
    

    out putenter image description here

    if($_POST['section'])
    {
    $sec=$_POST['section'];
    if($sec=="A")
        $j=1;
    else if($sec=="B")
        $j=51;
    
        for($i=0;$i<=49;$i++)
            { $k=$j+$i;
            if($i%5==0)
            {   echo "</br>";       }   
                echo '<input type ="Checkbox" value="'.$i . '">';   
    
    
            }
    

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

Sidebar

Related Questions

I have this project that it's due in a few hours and I still
So I have this section of my proc: SELECT com_contact.rc_name_full as CreatedBy, capComponent.cm_strike as
i have created a java project in eclipse,in this project i have an html
I have been developing a project and in this project i have designed my
folks! I have project in cc.net and this project nay start by 3 ways
So I have this project in PHP where I have some include files next
I have this Project model: class Project < ActiveRecord::Base validates :status, :inclusion => {
I have my project laid out like this: Project App1 App2 My static folder
I have a project with a structure like this: project code art config Art
I'm working on this project and I have to open a new browser tab.

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.