Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 22-02-2010
Member
 
Join Date: Nov 2009
Posts: 680
Calendar javascript in a JSP form

Hello everyone, I am creating a project in java programming language. And while creating it for avoiding concerns about the date format to enter value from the user I have added calender code which will fill out the entry dates in my jsp page. I got the code for a calendar which works in html but when I open the page with tomcat and I click on the field, it provide me problem. As I am not having any knowledge about the javascript, I want help from you to achieve the specified thing. So, please help me.
Reply With Quote
  #2  
Old 22-02-2010
Member
 
Join Date: May 2008
Posts: 2,383
Re: Calendar javascript in a JSP form

Hey, you simply need to make use of the javascript code below for in your jsp page code. So, just use it and get your problem solved:
Code:
<script type="text/javascript">
var date=new Date()
var month=date.getMonth()+1 
var year=date.getFullYear() 
document.write(buildCal(month ,year, "main", "month", "daysofweek", "days", 1));
</script>
Reply With Quote
  #3  
Old 22-02-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Calendar javascript in a JSP form

Hey, I am also working on one project. If you are not having knowledge about the java script, then simply refer the steps below which I have used to use the javascript.
1: The customer enters an address on his web browser (IE, FF ...)
2: a web server receives the request and finds the page associated with the'adresse
3: The page is interpreted by the web server. Clearly, the page is passed through the mill of the web server which has the effect of interpreting the language server
4: the response is forwarded to the customer
5: captures the browser interprets the response and in turn the answer.
Now, place the language in the right place:
Step 3: Server language => ASP, PHP, JSP,. NET ...
Step 5: Client language => HTML, JavaScript, CSS, Flash ...
Reply With Quote
  #4  
Old 22-02-2010
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Calendar javascript in a JSP form

Hello, I have the xml script below for creating a calender in a jsp form:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<agenda> 
  <event year="2010" month="2" date="22" bgcolor="#00ff00"
fgcolor="black" bgimg="" border="gold"> 
    <tooltip>this is a test</tooltip> 
    <action>alert(123)</action> 
  </event> 
  <event year="2010" month="1" date="1" bgcolor="green"
border="null"> 
    <tooltip>New Text</tooltip> 
    <action/> 
    <html><![CDATA]
<br> 
<b>New Text</b> 
    ]]></html> 
  </event> 
</agenda>
Reply With Quote
  #5  
Old 22-02-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Calendar javascript in a JSP form

Hi, If you make use of the java script below then you can able to create a calender for one year. So, just make use of it and get your problem solved.
Code:
<script language="javascript">
<!--
function Day(Dname)
{
     document.write("<TD ALIGN=center WIDTH=35>"+Dname+"</TD>")
}
function add(mon,mon_len)
{ 
  day=1
  document.write("<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=%3><TR>")
  document.write("<TD COLSPAN=7 ALIGN=center><B>"+mon+"   "+year+"</B><TR>")
  Day("Sun")
  Day("Mon")
  Day("Tue")
  Day("Wed")
  Day("Thu")
  Day("Fri")
  Day("Sat")
   document.write("</TR><TR>")
  for (var i=1;i<First;i++)
{
        document.write("<TD>")
  }
  for (var i=First;i<8;i++)
{
        document.write("<TD ALIGN=center>"+day+"</TD>")
        day++
  }
  document.write("<TR>")
  while (day <= mon_len)
 {
     for (var i=1;i<=7 && day<=mon_len;i++){
         document.write("<TD ALIGN=center>"+day+"</TD>")
         day++
     }
     document.write("</TR><TR>")
     First=i
  }
  document.write("</TR></TABLE><BR>")
}
</script>
<script language="javascript">
year=2008
today= new Date("January 1, "+year)
First = today.getDay() + 1  
add("January",31)
add("February",29)
add("March",31)
add("April",30)
add("May",31)
add("June",30)
add("July",31)
add("August",31)
add("September",30)
add("October",31)
add("November",30)
add("December",31)
</script>
<p align="center"><font face="Times New Roman" size="-2">This free script provided by</font><br>
<font face="Times New Roman, helvetica" size="-2"><a href="http://www.techarena.in">JavaScript
Kit</a></font></p>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Calendar javascript in a JSP form"
Thread Thread Starter Forum Replies Last Post
How to Submit a Form Using JavaScript? Damien25 Software Development 4 07-02-2010 07:05 AM
How to Reset or Clear a form using JavaScript? SKREECH Software Development 4 07-02-2010 06:50 AM
How to set the value of a form element using Javascript? shivendra Software Development 4 07-02-2010 05:04 AM
How to use Form Validation in JavaScript? Dilbert Software Development 4 30-01-2010 08:30 PM
Php form with javascript Solaris Software Development 3 30-11-2009 02:22 PM


All times are GMT +5.5. The time now is 05:29 AM.