How to add two calendars on the same html page

How to add two calendars on the same html page

I have used the same code as on this site http://www.roseindia.net/javascript/javascript-calendar.shtml for implementing calendar for my project.and the code is working fine when i use single calendar for a single html page.but while implementing two calendars on same html page it doesn't work..The first calendar works but the second calendar doesn't work.

I have googled it out and learnt that only we need to change the id..But i was unable to do find which id needs to be changed in this code.

Please someone help me with this..

View Answers

November 30, 2011 at 1:14 PM

Do changes in calendar.hmtl file. Rest of the code remains same.

<html>
<head>
   <title>Java Script Calender Date Picker</title>
   <meta http-equiv="Content-Type" content="text/html;">
   <script language="javaScript" type="text/javascript" src="calendar.js"></script>
     <link href="calendar.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#666666">
    <form>
      <input type="text" name="datum1"><a href="#" 
       onClick="setYears(1947, 2012);
       showCalender(this, 'datum1');">
       <img src="calender.png"></a>
<br>
       <input type="text" name="datum2"><a href="#" 
       onClick="setYears(1947, 2012);
       showCalender(this, 'datum2');">
      <img src="calender.png"></a>

    </form>

    <!-- Calender Script  --> 

    <table id="calenderTable">
       <tbody id="calenderTableHead">
         <tr>
           <td colspan="4" align="center">
         <select onChange="showCalenderBody(
                   createCalender(document.getElementById('selectYear').value,
               this.selectedIndex, false));"
                   id="selectMonth">
                  <option value="0">Jan</option>
                  <option value="1">Feb</option>
                  <option value="2">Mar</option>
                  <option value="3">Apr</option>
                  <option value="4">May</option>
                  <option value="5">Jun</option>
                  <option value="6">Jul</option>
                  <option value="7">Aug</option>
                  <option value="8">Sep</option>
                  <option value="9">Oct</option>
                  <option value="10">Nov</option>
                  <option value="11">Dec</option>
              </select>
            </td>
            <td colspan="2" align="center">
        <select onChange="showCalenderBody(createCalender(this.value, 
          document.getElementById('selectMonth').selectedIndex, false));"
              id="selectYear">
        </select>
            </td>
           <td align="center">
        <a href="#" onClick="closeCalender();">
              <font color="#003333" size="+1">X</font>
            </a>
       </td>
    </tr>
       </tbody>
       <tbody id="calenderTableDays">
         <tr style="">
           <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td>
           <td>Thu</td><td>Fri</td><td>Sat</td>
         </tr>
       </tbody>
       <tbody id="calender"></tbody>
    </table>

<!-- End Calender Script  --> 

  </body>
</html>

November 30, 2011 at 2:29 PM

Thanks this was what i expected..

Thanks a lot









Related Tutorials/Questions & Answers:
How to add two calendars on the same html page
How to add two calendars on the same html page  I have used the same... use single calendar for a single html page.but while implementing two calendars on same html page it doesn't work..The first calendar works but the second
how to add the two tables in same row when generating pdf file from jsp - JSP-Servlet
how to add the two tables in same row when generating pdf file from jsp  How to add the two tables in same row one is left side and other is right side please help me.   Hi Friend, Try the following code
Advertisements
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
add same tables in jsp page
add same tables in jsp page  hi I have a table in my jsp page with data, now I want to add same copy of table without its default value in same page whenever I click add more table, how do I do
how to add the calendar to the dynamic rows in html or jsp page - JSP-Servlet
how to add the calendar to the dynamic rows in html or jsp page   Hi Sir, i have 3 columns in my jsp page date of payment,amount recieved,no and i have 2 button in my jsp page ADD and delete button. when i click on add
how i connect two page
how i connect two page  strong textlink text
How to add two numbers in Java?
How to add two numbers in a Java program? In Java you can easily add two number by using the plus (+) operator. The plus operator will add two... this will print: Sum is: 30 So, in this program you learned how to sum(add) two numbers
Two or more actions in the same form
Two or more actions in the same form  Can I have two or more actions in the same form
how to show hyperlink website on the same page
how to show hyperlink website on the same page  dear sir: i need to know how can you show a webiste on the same page. for example i want to show... on the same page weather it is left aligned or right. i read somewhere that you
how to get values for same column name from two different tables in SQL
how to get values for same column name from two different tables in SQL  how to get values for same column name from two different tables in SQL???? column name is emp_id loacated in these two tables company,employee
How to redirect from a HTML page?
How to redirect from a HTML page?  Hi, Is it possible to redirect from HTML page to another page on the net? I have one page and I want to redirect... to redirect to another page using HTML code. You can use the following code: <meta
how to do two database tables in one page?
how to do two database tables in one page?  dear all: i want to show these two database tables in one page. one table on the left (dbtable.jsp) and the other on the right (table2.jsp). how can i do that with HTML? this is my
How to display content in same page while selecting fron dropdown list
How to display content in same page while selecting fron dropdown list ... HTML page is created and is sent to the browser so, any event is encountered...),then it want to display all records from table specific to that rollno in that same
How can I output text typed in textarea by user on the same page?
How can I output text typed in textarea by user on the same page?  I have a basic HTML page where I have created a textarea for users comments. I would like to take the comments and append them to the same page for all to see
how to use dropdown list in JSP and display value in same page
in the same page Value selected = C How can we do this in a JSP page...how to use dropdown list in JSP and display value in same page  I... one option the value must get displayed below it in the same page
How To Include Two Jsp page in another jsp page?
How To Include Two Jsp page in another jsp page?  I use following code to Include Two Jsp Page Header and footer <%@include file="header.jsp... in page How can i Display at correct position?   Please visit
How to display content in same page while selecting fron dropdown list
How to display content in same page while selecting fron dropdown list  Thanks for your suggesstion.but Please provide me coding by using only one dropdownlist in javascript or jquery.Thanks in advance
Two Pagination in one page
Two Pagination in one page  hai friends any one help me. how do u make two pagination script in same page i'm used some ajax coding one pagination script is working but another pagination is not working please help me urgent
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE ... is how to get Roleid in textbox when i select Role_name from combobox in a same... SystemAdmin 2 Office Bearer Am loading this Rolename into one page called
Servlets errors in same page.
Servlets errors in same page.  How do I display errors list in the same page where a form field exists using servlets...........i.e. without using JSP? Please explain with a simple username password program
Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list
Displaying checked checkbox in same page as well as print on another page... display selected checkbox on same page. It works... But when i go to another page link containing same format, it does not display previous page's selected
Add two number in java
Add two number in java In this section you will learn about how to add two... be added, So two add,  convert these String into numeric type..."); System.out.println("Please Enter two number to add :"); Scanner sin=new
how to add new column before two column in sql.
how to add new column before two column in sql.  how to add new column in table before two column in sql.   Syntax of Alter table: ALTER... named 'employee' having three fields id, name and salary. Now we want to add two
how to add new column before two column in sql.
how to add new column before two column in sql.  how to add new column in table before two column in sql.   Syntax of Alter table: ALTER... named 'employee' having three fields id, name and salary. Now we want to add two
how to add new column before two column in sql.
how to add new column before two column in sql.  how to add new column in table before two column in sql.   Syntax of Alter table: ALTER... named 'employee' having three fields id, name and salary. Now we want to add two
how to add new column before two column in sql.
how to add new column before two column in sql.  how to add new column in table before two column in sql.   Syntax of Alter table: ALTER... named 'employee' having three fields id, name and salary. Now we want to add two
how to include an html page inside a tab
how to include an html page inside a tab  how to include an static html page inside a tab(in jquery)   Please visit the following links...;actually i want to knw how to include an google page inside a tab(suppose in 2nd
How can you add elements of two arrayLists in java?
How can you add elements of two arrayLists in java?  if you have an arrayList of tempArr = [hi, my, name, is, john] and another arrayList..., is d, john e] how do you go about
How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi, I am doing a project and i want to browse and upload the file in same page inside... and saved into database. upload.jsp <%@ page import="java.io.*" %> <
How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi Sir... the file in cell if a table in same page, post answer as soon as possible.thanks... to server and saved into database. upload.jsp <%@ page import="java.io.
How to pass parametes from JSP page to HTML page? - JSP-Servlet
How to pass parametes from JSP page to HTML page?  Hi all, In my project I have one JSP page and one HTML page. In JSP page I have created HTML... with the username in HTML which I have called in JSP page. So I just want
Posting comments to same page with textarea
to the same page. Many thanks for that. However I wanted it to add other...Posting comments to same page with textarea  I have been given some... great code Comment: user two wrote I agree Comment: user three wrote I agree
how to add two object in a particular file - Java Beginners
how to add two object in a particular file  Hi frend.. I have two arraylist object in which there is some data..............now i want to add these two objects in a particular file using file handling in java....and also
login for different user in the same page
login for different user in the same page  how can i do the login for different user in the same page throug jsp
populating a screen on the same page
populating a screen on the same page  i'm making a time table in jsp... to a new page which will help them to choose the subject and faculty through drop... to select the subject and faculty....so that we dont need to redirect to other page
Add two big numbers
Add two big numbers       In this section, you will learn how to add two big numbers...(BigDecimal big): This method is used to add the two BigDecimal numbers. Here
how to execute the below servlet with html page
how to execute the below servlet with html page  //vallidate user n...,ServletException { res.setContentType("text/html"); PrintWriter out=res.getWriter... res)throws IOException,ServletException { res.setContentType("text/html
How to extract HTML elements from a page?
HTML Scrapping: How to extract HTML elements from a page? In this tutorial we are going to teach you how to extract the HTML elements from a web page... for extracting HTML element from a page. We will extract the data from the html table
How to extract HTML elements from a page?
HTML Scrapping: How to extract HTML elements from a page? In this tutorial we are going to teach you how to extract the HTML elements from a web page...; So, we have learned how to extract the html elements from the web page
Applet for add two numbers
Applet for add two numbers  what is the java applet code for add two...); add(text2); label3 = new Label("Sum of Two Numbers...: "); label1.setBounds(20,20,100,20); add(label1); text1 = new TextField(5
Program to check whether two given words pronouncing same or not?
Program to check whether two given words pronouncing same or not?  Program to check whether two given words pronouncing same or not? example: raju and rajoo pronouncing same please help me out
how to pass form values from javascript of html page to jsp page
how to pass form values from javascript of html page to jsp page   This is my sample html page which contains inline javascript which calculates the geocode and tries to return the lattitude and longitude .But my question is how
Populate value into HTML page
Populate value into HTML page  Hi, How to populate values from one html page table to another html page..? Thanks
divide html page
divide html page   how to divide html page into 3 parts without using frames
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
problem in swing program for opening two windows with same login credentials
problem in swing program for opening two windows with same login credentials  I Face two problems while writing the code in swing program 1.i... into the system with same username,password two times then it opens two separate
simplest HTML page
simplest HTML page  What is the simplest HTML page
page breaks in HTML
page breaks in HTML  How do I specify page breaks in HTML

Ads