0

did anyone know how to make a calendar by using javascript? actually i want to put calendar next to text field, so that, the user can easily select the date and the date will come out in the text field......help me plzzz.....

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by asyieen
0

Put the attached folder in the folder in which your application resides. Then Insert the following javascript above the code for your form.

<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-1.css" title="win2k-1" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>

Then put the following code just after the code in form where you are making textbox for calendar.

&nbsp;<img src="images/ew_calendar.gif" id="id of field" alt="Pick a Date" style="cursor:pointer;cursor:hand;">
  <script type="text/javascript">
Calendar.setup(
{
inputField : "id of date field", // ID of the input field
ifFormat : "%Y/%m/%d", // the date format
button : "button id" // ID of the button
}
);
0

to shanti....thanks for ur attachment and info.....but, i got a problem...when i click on the date, the date will not reside the text field.....here, the attachment....the page come out on the calendar....why is that happened? i'll send u my coding.....

Attachments
<html>
<head><script type="text/javascript" src="claender.js">
</script>
<title>create project</title></head>
<body background = "pictures/images.jpg" >
<img src = "pictures/images1.jpg" width = "1000" height = "100">
<p><center><h3><b><font color = "#9999cc">Create Project</font></b></h3></center></p>

<?php

	
	switch($_GET["action"]){
	
	default:
?>



	<b>Project Info</b><br>

	<form name ="projectinfo" action = "displaycreateproject.php" method = "POST">

	<input type = "hidden" name = "action" value= "projectinfo">
	
	<table cellspacing="5" cellpadding="5" border="0">
	
	<tr><td>Project Name:</td><td style = "padding-left:5px;"><input type="text" name="projectname" ></td></tr>
	<tr><td>Date Awarded:</td><td style = "padding-left:5px;"><input type="text" name="dateawarded"></td></tr>
   	<tr><td>Start Date:</td><td style = "padding-left:5px;"><input type="text" name="datestart"></td></tr>
	<tr><td>End Date:</td><td style="padding-left:5px;"><input type="text" name="dateend" ></td></tr>
	<tr><td>Plan Release:</td><td style = "padding-left:5px;"><input type="text" name="releaseno"></td></tr>
   	<tr><td>Remarks:</td><td style = "padding-left:5px;"><input type="text" name="remarks"></td></tr>

	</table><tr><td align = "center">
	<td colspan="2" align="right"><input type="submit" value ="Submit"/>
	<colspan="2" align="right"><input type="reset" value ="Reset"/></td></tr>
	</form><br><br><br><br>

<?php	
	
break;
	
	case 'projectplan':
?>


	<b>Project Plan / Activity List</b>
	
	
<?php
	$projectid = $_GET["projectid"];
	
?>


	<form name = "projectplan" action = "displaycreateproject.php" method = "post">
	<input type = "hidden" name = "action" value = "projectplan">
	<input type = "hidden" name = "projectid" value = "<?php echo $projectid ?>">
	

  <table cellspacing="3" cellpadding="3" border="0">

<TR><br>Task Name:<input type="text" name="taskname" >



<form action=""  method="post" enctype="multipart/form-data" name="formaddrem" >
<td align = "center"><br>Start Date:<input name="dop2" type="text" class="mbox3" id="dop2"  value="" />
<a href="javascript:show_calendar('formaddrem.dop2');"><img src="calender.gif" width="21" height="17" border="0" align="absmiddle" /></a>


<br><br>End Date:<input name="dop2" type="text" class="mbox3" id="dop2"  value="" />
                    <a href="javascript:show_calendar('formaddrem.dop2');"><img src="calender.gif" width="21" height="17" border="0" align="absmiddle" /></a>
                    
                    
 
<br><br>Remarks:<input type="textarea" cols = "20" name="description" >  
                    
	
	
		

	

	</table><tr><td align = "center">
	<td colspan="2" align="right"><input type="submit" value ="Submit"/>
	<colspan="2" align="right"><input type="reset" value ="Reset"/></td></tr>
	</form><br><br><br><br>
<?php	
	
break;

	case 'pointofcontact':
	
?>
	<b>Point of Contact</b>
<?php
	$projectid = $_GET["projectid"];
?>
	<form name = "pointofcontact" action = "displaycreateproject.php" method = "post">
	<input type = "hidden" name = "action" value = "pointofcontact">
	<input type = "hidden" name = "projectid" value = "<?php echo $projectid ?>">
	
	<form action="../" onsubmit="return checkCheckBoxes(this);">
	Asyiqin
	<input type="checkbox" name="Asyiqin" value="Asyiqin">
	<br>
	Salwa 
	<input type="checkbox" name="Salwa" value="Salwa">
	<br>
	Erhilyaty 
	<input type="checkbox" name="Erhilyaty" value="Erhilyaty">
	

	<td colspan="2" align="right"><input type="submit" value ="Submit"/>
	<colspan="2" align="right"><input type="reset" value ="Reset"/></td></tr>
	</form></form><br><br><br><br>
	
	
<?php
	
break;

	case "projectmanager":
	
?>
	<b>Project Manager</b>
	
<?php

$projectid = $_GET['projectid'];

?>



	<form name = "projectmanager" action = "displaycreateproject.php">
	<input type = "hidden" name = "action" value = "projectmanager">
	<input type = "hidden" name = "projectid" value = "<?php echo $projectid ?>">
	
	<table cellspacing="5" cellpadding="5" border="0">

	<tr><td align = "center">Project Manager:</td><td><select name="Asyiqin">
	<option value="Asyiqin">Asyiqin</option>
	<option value="Salwa" >Salwa</option>
	</select></tr>
	</table><tr><td align = "center">


	<td colspan="2" align="right"><input type="submit" value ="Submit"/>
	</td></tr>
	</form><br><br><br><br>
	
<?php

break;

	case "uploaddownload":
	
?>
	<b>Upload / Download Document</b>
<?php
	$projectid = $_GET ["projectid"];
?>
	<form uploaddownload action = "displaycreateproject.php">
	<input type = "hidden" name = "action" value = "uploaddownload">
	<input type = "hidden" name = "projectid" value = "<?php echo $projectid ?>">


	<table cellspacing="5" cellpadding="5" border="0">

	<tr><td align = "center">Project ID:</td><td style = "padding-left:5px;"><input type="text" name="projectid" ></td></tr>
	<tr><td align = "center">Document Name:</td><td style = "padding-left:5px;"><input type="text" name="docname"></td></tr>
   	<tr><td align = "center">Remarks:</td><td style = "padding-left:5px;"><input type="text" name="remarks"></td></tr>
		
	<tr><td align="center">File:</td><td style="padding-left:5px;"><input type="text" name="uploadfile" ><a href = "Browse"></a></td></tr>
		

	</table><tr><td align = "center">


	<td colspan="2" align="right"><input type="submit" value ="Submit"/>
	<colspan="2" align="right"><input type="reset" value ="Reset"/></td></tr>
	</form>	
<?php

}
?>
</body>

</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.