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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:34:01+00:00 2026-05-28T05:34:01+00:00

I have the form with selected boxes like below. i need to group the

  • 0

I have the form with selected boxes like below.
enter image description here

i need to group the first two select boxes “Select Session” and “Select Time”, i need to allow select unique sessions and time for each pair of dropdowns. If i selected one session and time in one drop down and again i selected the same session and time in the below dropodwns that time i have to pop up the error message like “Same session and time Already Selected”.

How can i do this?.. the HTML code is

 <div class="line_div">
        <p>You can enroll in one or more sessions:</p>
        <div class="sgl_part_div">
            <span class="cmt">Select Session</span><span>:</span>
            <select id="first" name="first" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
<option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
<option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
<option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
<option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
<option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>

            </select>
          </div>
          <div class="sgl_part_div">
            <span class="cmt">Select Time</span><span>:</span>
            <select id="first" name="first" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">#1 only: 1pm</option>
<option value="">#1 only: 1:30pm</option>
<option value="">#1 only: 2pm</option>
<option value="">#1 only: 2:30pm</option>
<option value="">#1 only: 3:30pm</option>
<option value="">#1 only: 4pm</option>
<option value="">#1 only: 4:30 pm</option>
<option value="">#1 only: 5:00pm</option>
<option value="">9am</option>
<option value="">9:30am</option>
<option value="">10 am</option>
<option value="">10:30am</option>
<option value="">11 am</option>
<option value="">11:30am</option>
<option value="">12:30 pm</option>
<option value="">1:00pm</option><option value="">1:30pm</option>
            </select>
          </div>
          <div class="sgl_part_div">
            <span class="cmt">Select Session</span><span>:</span>
            <select id="second" name="second" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
<option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
<option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
<option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
<option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
<option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>

            </select>
          </div>
          <div class="sgl_part_div">
            <span class="cmt">Select Time</span><span>:</span>
            <select id="second" name="second" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">#1 only: 1pm</option>
<option value="">#1 only: 1:30pm</option>
<option value="">#1 only: 2pm</option>
<option value="">#1 only: 2:30pm</option>
<option value="">#1 only: 3:30pm</option>
<option value="">#1 only: 4pm</option>
<option value="">#1 only: 4:30 pm</option>
<option value="">#1 only: 5:00pm</option>
<option value="">9am</option>
<option value="">9:30am</option>
<option value="">10 am</option>
<option value="">10:30am</option>
<option value="">11 am</option>
<option value="">11:30am</option>
<option value="">12:30 pm</option>
<option value="">1:00pm</option><option value="">1:30pm</option>
            </select>
          </div>
          <div class="sgl_part_div">
            <span class="cmt">Select Session</span><span>:</span>
            <select id="third" name="third" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
<option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
<option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
<option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
<option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
<option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>

            </select>
          </div>
          <div class="sgl_part_div">
            <span class="cmt">Select Time</span><span>:</span>
            <select id="third" name="third" class="tx_bx" value="">
                <option value="">- Select -</option>
                <option value="">#1 only: 1pm</option>
<option value="">#1 only: 1:30pm</option>
<option value="">#1 only: 2pm</option>
<option value="">#1 only: 2:30pm</option>
<option value="">#1 only: 3:30pm</option>
<option value="">#1 only: 4pm</option>
<option value="">#1 only: 4:30 pm</option>
<option value="">#1 only: 5:00pm</option>
<option value="">9am</option>
<option value="">9:30am</option>
<option value="">10 am</option>
<option value="">10:30am</option>
<option value="">11 am</option>
<option value="">11:30am</option>
<option value="">12:30 pm</option>
<option value="">1:00pm</option><option value="">1:30pm</option>
            </select>
          </div>

         </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-28T05:34:01+00:00Added an answer on May 28, 2026 at 5:34 am

    I have written the code for this one. it’s working. Find below the structure.

    HTML Structure is,

        <div class="line_div">
            <p>You can enroll in one or more sessions:</p>
            <div class="sgl_part_div">
    
                <span class="cmt">Select Session</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
    <option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
    <option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
    <option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
    <option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
    <option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>
    
                </select>
              </div>
              <div class="sgl_part_div">
                <span class="cmt">Select Time</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">#1 only: 1pm</option>
    <option value="">#1 only: 1:30pm</option>
    <option value="">#1 only: 2pm</option>
    <option value="">#1 only: 2:30pm</option>
    <option value="">#1 only: 3:30pm</option>
    <option value="">#1 only: 4pm</option>
    <option value="">#1 only: 4:30 pm</option>
    <option value="">#1 only: 5:00pm</option>
    <option value="">9am</option>
    <option value="">9:30am</option>
    <option value="">10 am</option>
    <option value="">10:30am</option>
    <option value="">11 am</option>
    <option value="">11:30am</option>
    <option value="">12:30 pm</option>
    <option value="">1:00pm</option><option value="">1:30pm</option>
    
               </select>
              </div>
             <div class="sgl_part_div">
                <span class="cmt">Select Session</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
    <option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
    <option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
    <option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
    <option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
    <option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>
    
                </select>
              </div>
              <div class="sgl_part_div">
                <span class="cmt">Select Time</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">#1 only: 1pm</option>
    <option value="">#1 only: 1:30pm</option>
    <option value="">#1 only: 2pm</option>
    <option value="">#1 only: 2:30pm</option>
    <option value="">#1 only: 3:30pm</option>
    <option value="">#1 only: 4pm</option>
    <option value="">#1 only: 4:30 pm</option>
    <option value="">#1 only: 5:00pm</option>
    <option value="">9am</option>
    <option value="">9:30am</option>
    <option value="">10 am</option>
    <option value="">10:30am</option>
    <option value="">11 am</option>
    <option value="">11:30am</option>
    <option value="">12:30 pm</option>
    <option value="">1:00pm</option><option value="">1:30pm</option>
                </select>
              </div>
              <div class="sgl_part_div">
                <span class="cmt">Select Session</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">Session #1: Tues May 31st - Fri June 10th (1-5:30PM)</option>
    <option value="">Session #2: Tues June 14th - Fri June 24th (9-2:00PM)</option>
    <option value="">Session #3: Tues June 28th - Fri July 8th (9-2:00PM)</option>
    <option value="">Session #4: Tues July 12th - Fri July 22nd (9-2:00PM)</option>
    <option value="">Session #5: Tues July 26th - Fri Aug 5th (9-2:00PM)</option>
    <option value="">Session #6: Tues Aug 9th - Fri Aug 19th (9-2:00PM)</option>
    
                </select>
              </div>
              <div class="sgl_part_div">
                <span class="cmt">Select Time</span><span>:</span>
                <select id="country" name="country" class="tx_bx" value="">
                    <option value="">- Select -</option>
                    <option value="">#1 only: 1pm</option>
    <option value="">#1 only: 1:30pm</option>
    <option value="">#1 only: 2pm</option>
    <option value="">#1 only: 2:30pm</option>
    <option value="">#1 only: 3:30pm</option>
    <option value="">#1 only: 4pm</option>
    <option value="">#1 only: 4:30 pm</option>
    <option value="">#1 only: 5:00pm</option>
    <option value="">9am</option>
    <option value="">9:30am</option>
    <option value="">10 am</option>
    <option value="">10:30am</option>
    <option value="">11 am</option>
    <option value="">11:30am</option>
    <option value="">12:30 pm</option>
    <option value="">1:00pm</option><option value="">1:30pm</option>
                </select>
              </div>
            </div>
    

    And the script is,

    <script type="text/javascript">
    function chng(index)
    {
        selectelement = document.getElementById('first1');
        selectelementtime = document.getElementById('first_time1');
        var seltxt = selectelement.options[ selectelement.selectedIndex ].value;
        var seltime = selectelementtime.options[ selectelementtime.selectedIndex ].value;
        var session_time = seltxt+seltime;
    
    
        selectelement1 = document.getElementById('first2');
        selectelementtime1 = document.getElementById('first_time2');
        var seltxt1 = selectelement1.options[ selectelement1.selectedIndex ].value;
        var seltime1 = selectelementtime1.options[ selectelementtime1.selectedIndex ].value;
        var session_time1 = seltxt1+seltime1;
    
    
        selectelement2 = document.getElementById('first3');
        selectelementtime2 = document.getElementById('first_time3');
        var seltxt2 = selectelement2.options[ selectelement2.selectedIndex ].value;
        var seltime2 = selectelementtime2.options[ selectelementtime2.selectedIndex ].value;
        var session_time2 = seltxt2+seltime2;
    
    //alert(session_time1);
    //alert(session_time);
    //alert(session_time2);
    if(session_time == session_time1 || session_time1 == session_time2 || session_time2 == session_time )
        {
    
            alert("Matches Found");
            var selopt = "first"+index;
            var seltime = "first_time"+index;
            document.getElementById(selopt).options.selectedIndex = 0;
            document.getElementById(seltime).options.selectedIndex = 0;
    
    
    }
    
    }
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two input boxes and two select boxes and would like to display
I have two select elements in my form, Category and Sub-category. At first, only
I have a select form element with 5 options. If option 2 is selected
I have a form where a user can add multiple select boxes for multiple
I have a form in VB6 with two combo boxes (cboCustomer and cboItemNumber). When
So I have several select boxes like this: <select class=designer> <option>300</option> <option>3422</option> </select> <select
If I have a form like this . <form name=myform action= method=POST> <select name=mydropdown>
I have a form with a select box and three text input boxes. When
I have two multi-select list boxes; one with months and one with years such
I have a form with 4 dropdowns on it. The default selected option in

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.