Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP Datepicker not getting called through include function of php

Have Programming Question? Ask it here!
 
 
 


tarak nath
Datepicker not getting called through include function of php
0 Answer(s)      7 months ago
Posted in : PHP


my datepicker.php is as below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>datepicker</title>
<link href="css/datepicker.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/datepicker.js"></script>
<script type="text/javascript">
//<![CDATA[

/*
        A "Reservation Date" example using two datePickers
        --------------------------------------------------

        * Functionality

        1. When the page loads:
                - We clear the value of the two inputs (to clear any values cached by the browser)
                - We set an "onchange" event handler on the startDate input to call the setReservationDates function
        2. When a start date is selected
                - We set the low range of the endDate datePicker to be the start date the user has just selected
                - If the endDate input already has a date stipulated and the date falls before the new start date then we clear the input's value

        * Caveats (aren't there always)

        - This demo has been written for dates that have NOT been split across three inputs

*/

function makeTwoChars(inp) {
        return String(inp).length < 2 ? "0" + inp : inp;
}

function initialiseInputs() {
        // Clear any old values from the inputs (that might be cached by the browser after a page reload)
        document.getElementById("sd").value = "";
        document.getElementById("ed").value = "";

        // Add the onchange event handler to the start date input
        datePickerController.addEvent(document.getElementById("sd"), "change", setReservationDates);
}

var initAttempts = 0;

function setReservationDates(e) {
        // Internet Explorer will not have created the datePickers yet so we poll the datePickerController Object using a setTimeout
        // until they become available (a maximum of ten times in case something has gone horribly wrong)

        try {
                var sd = datePickerController.getDatePicker("sd");
                var ed = datePickerController.getDatePicker("ed");
        } catch (err) {
                if(initAttempts++ < 10) setTimeout("setReservationDates()", 50);
                return;
        }

        // Check the value of the input is a date of the correct format
        var dt = datePickerController.dateFormat(this.value, sd.format.charAt(0) == "m");

        // If the input's value cannot be parsed as a valid date then return
        if(dt == 0) return;

        // At this stage we have a valid YYYYMMDD date

        // Grab the value set within the endDate input and parse it using the dateFormat method
        // N.B: The second parameter to the dateFormat function, if TRUE, tells the function to favour the m-d-y date format
        var edv = datePickerController.dateFormat(document.getElementById("ed").value, ed.format.charAt(0) == "m");

        // Set the low range of the second datePicker to be the date parsed from the first
        ed.setRangeLow( dt );

        // If theres a value already present within the end date input and it's smaller than the start date
        // then clear the end date value
        if(edv < dt) {
                document.getElementById("ed").value = "";
        }
}

function removeInputEvents() {
        // Remove the onchange event handler set within the function initialiseInputs
        datePickerController.removeEvent(document.getElementById("sd"), "change", setReservationDates);
}

datePickerController.addEvent(window, 'load', initialiseInputs);
datePickerController.addEvent(window, 'unload', removeInputEvents);

//]]>
</script>

<!--sa error trapping-->
<script type="text/javascript">
function validateForm()
{
var x=document.forms["index"]["start"].value;
if (x==null || x=="")
  {
  alert("you must enter your check in Date(click the calendar icon)");
  return false;
  }
var y=document.forms["index"]["end"].value;
if (y==null || y=="")
  {
  alert("you must enter your check out Date(click the calendar icon)");
  return false;
  }
}
</script>

</head>

<body>
<h2 class="style2">RESERVATION FORM </h2>

<form method="post" action="testing.php" name="index" onsubmit="return validateForm()">
<div style="margin-top:20px; margin-left:10px;">
 <table width="186" border="0">
  <tr>
    <td width="69"><div align="right">
      <label>Start Date : </label>
    </div></td>
    <td width="101"><input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="start" id="sd" value="" maxlength="10" readonly="readonly" /></td>
  </tr>
  <tr>
    <td><div align="right">
      <label>End Date : </label>
    </div></td>
    <td><input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="end" id="ed" value="" maxlength="10" readonly="readonly" /></td>
  </tr>
  <tr>
    <td><div align="right">
      <label>Adult : </label>
    </div></td>
    <td><select name="adult" class="ed" >
      <option>1</option>
      <option>2</option>
      <option>3</option>
    </select></td>
  </tr>
  <tr>
    <td><div align="right">
      <div align="right">
        <label>Child : </label>
      </div>
    </div></td>
    <td><select name="child" class="ed">
      <option>0</option>
      <option>1</option>
      <option>2</option>
    </select></td>
  </tr>
  <tr>
    <td><div align="right"></div></td>
    <td><input name="Input" type="submit" value="Check Availability" id="button" /></td>
  </tr>
  <tr>
    <td colspan="2"><div align="right"><a rel="facebox" href="modifyindex.php">Modify</a> / <a href="cancelindex.php">Cancel</a> Reservation </div></td>
    </tr>
</table> 
 </div>    
</form>

</body>
</html>
                 When I call this datepicker through include function as below..it is not working.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>call datepicker</title>
</head>

<body>
<?php include "datepicker.php" ?>
</body>
</html>

Please help


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Datepicker not getting called through include function of php
Datepicker not getting called through include function of php  my...; When I call this datepicker through include function as below...;/title> </head> <body> <?php include "datepicker.php" ?>
php include
php include  i'm trying to include a header on my page but it doesn't display anything here's my code
Advertisements
include php in html
include php in html  Actually, i have two different pages for my application.. 1) includes the HTML tags and designing. And second includes the PHP... into HTML page.   This is how you can include a PHP file into HTML <
why php is called hypertext preprocessor - PHP
why php is called hypertext preprocessor  why php is called hypertext preprocessor
If function in PHP
If function in PHP  Hi, Provide me the example of If function in PHP. Thanks   Hi, If function is PHP is used to check for some condition and the execute a block of code. He is an example of if() function in PHP
PHP Variable Outside Function
PHP Variable Outside Function In PHP Functions, a variable can be called... the example to understand how it works : PHP Variable Outside Function Example 1... the above output on your screen or browser. Example 2 : <?php function
php Include
php Include:       Include command provides the opportunity to include several php pages within a single page. This feature facilitates us to save our time. Include takes a file name
variable function in php
variable function in php  Can any one tell me how to write a variable function in PHP?   Go through the PHP Variable function tutorial ... PHP Variable Function
php array length function
php array length function  writing a php array length function
call function in php
call function in php  What is the call function in PHP please explain
php include and require
php include and require       In php include and require are almost same but the difference between these two... are different. Example (using include): <?php include ('NewAjax.php'); echo
What is the microtime() Function PHP ?
What is the microtime() Function PHP ?   Hi, What is microtime() Function in PHP? What is the role of Microtime() Function in PHP. Please suggest me any online reference. Thanks
php error handling function
php error handling function  Is there any library or function that can be used to handle errors in PHP
Eval Function in PHP
Eval Function in PHP  Hello PHP experts, Please tell me about Eval() Function in PHP. How to use Eva() function in PHP? Thanks   Hi, The Eval() function is PHP is very handy. It allows to you store the PHP code
array_merge function in php - PHP
array_merge function in php  What is the best use of array_merge function in php?  Hi Friend, Please visit the following links: http://www.roseindia.net/tutorial/php/phpbasics/PHP-Array-Merge-Recursive.html http
post function php
post function php  when should i use post function in PHP
variable function in php
variable function in php  Can any one tell me how to write a variable function in PHP
Array Sizeof Function PHP
Array Sizeof Function PHP  Hi, How to count the number of elements in an array using the PHP Array sizeof() function? Please provides me online help links or example of array sizedof() PHP. Thanks
PHP idate() Function
help related to PHP idate() Function. I waiting for your valuable suggestion. Thanks,   Hi, The idate() Function in PHP will returns a string... time if no timestamp is given. Syntax of PHP idate() Function :... int idate
php function call
php function call  I have an function in error-status.php like this function validateHostName($hostName) { if((strpbrk($hostName,'`~!@#$^&... to cal this function in my other page which is datetime.php how it is posible
What is the functionality of MD5 function in PHP?
What is the functionality of MD5 function in PHP?  What is the functionality of MD5 function in PHP
php timezone function
php timezone function  how can i change the timezone using PHP
Eval () PHP Function, Example of Eval () PHP Function
PHP eval() Function In this tutorial we will learn about the PHP eval() function. The php eval() function can be used if you want to store the php command... eval() function: The PHP eval() function evaluates the passed string parameter
Validation of datepicker
Validation of datepicker  I have a datepicker in my JSp...the seleted dates are put in a text box. I want the alert the user from selecting future dates in the startDate and enddate textbox.So that the user will be alerted wen
PHP User Defined Function
PHP User Defined Function An user-defined function saves  us from ... is: function function_name([mixed $var,.....]){ PHP code} mixed is the datatype...;?php function add($first,$second) { return ($first+$second
PHP toString Function
now it is just a function call away. This method is called implictly, whenever... of the object, if we try to print the object, __toString() function is called implicitly and print the value of the member variable. PHP toString Function
How to use the PHP filetype() Function
How to use the PHP filetype() Function  Hi, What is the use of filetype() Function in php programming. Can anyone give any online example of the PHP filetype() Function. Thanks
PHP basename() function, PHP basename function example
In this section we will learn about the basename() function of php This example of basename()  function in PHP Description about PHP basename(): syntax for PHP basename()Function string basename ( string
jquery datepicker example
jquery datepicker example  √?¬†jquery datepicker example - i wants...-ui.css"> <script type="text/javascript"> $(function() { $('.date-picker').datepicker( { changeMonth: true, changeYear: true
PHP file_get_contents() Function
PHP file_get_contents() Function  Hi, How do i read the content of file using PHP program? So kindly provide any example or online help reference for filegetcontents() Function in PHP. Please feel free to suggest. Thanks
The fgetcsv function example in PHP, fgetcsv php, fgetcsv in php
Examples of fgetcsv() function in php Description The PHP fgetcsv() function is used to parse the CVS file in PHP program. Here you will see how you... on failure and EOF. Code for PHP fgetcsv() Function in PHP <?php $file1
feof() Function in php
Examples of the feof() function in PHP Syntax on feof() function in PHP bool feof ( $file_pointer ) It is used for checking the end of file of ... and then the loop will terminate Code for feof() function in PHP <?php
How to Declare fflush() Function in PHP
How to Declare fflush() Function in PHP  Hi, Can someone give my any online example for write all the buffered data of an open file. Is it appropriate to use the PHP fflush() Function to develop this application? Please suggest
PHP function fopen and example
of PHP fopen() Function Code for PHP fopen() Function <?php   ... Syntax file_handler fopen(file_name,file_mode,[path_include,[context]]) It opens the given file with the given mode and return the file handler Using
Multiple implementaion of datepicker.
Multiple implementaion of datepicker.  Hello Sir I am using date...="EndDate" class="calendar" /> Then, in your document.ready function: $('.calendar').datepicker(); Using it that way for multiple calendar fields works
PHP Date function
PHP Date Function In this section we will show you the different formatting options available in the PHP Date function PHP date() function provides many...]  ) Following tables shows formats and its description in the PHP
Overview of Networking through JAVA,Getting the Local port
Getting the Local port       In this section you will learn that how a user can access the Local port. Here we are going to make it easier to understand the step be step
The PHP Date() Function
The PHP Date() Function The PHP date() function is used for formatting... date and time. No installation is necessary for using this function.  Syntax... formatting. For example: <?php echo date("Y/m/d") . "<br />
List out different arguments in PHP header function?
List out different arguments in PHP header function?   List out different arguments in PHP header function
PHP lstat() function and example
Syntax for PHP Istat() Function array lstat (file_name) PHP Istat() Function states about the regular file and symbolic file information PHP Istat() Function will returns the data in Array form PHP Istat() Function
PHP filesize() function and example
Syntax int filesize(file_name) It gives the size in bytes.  Example of filesize() Function in PHP <?php     $size=filesize("c:/rose1/ram.txt");     echo "size is ".$size
The file function example in PHP, file php, file in php
In this php tutorial section we will be learning the file() function of PHP...() function in PHP array file ( filename, [,flags [, context]] ) It returns... values  as  FILE_BINARY(default),FILE_USE_INCLUDE_PATH,FILE_IGNORE_NEW_LINES
PHP Function
manageable, robust. A general format of the function in PHP is as follows... to the calling portion. One function can be called number of times, and one function can...;?php function add($a,$b){ return $a+$b;} $c=add(12,39); echo "
PHP strtotime, PHP strtotime Function, strtotime Function, strtotime Function Example
PHP strtotime Function In this section we will learn strtotime with the help of example code. About strtotime function: The strtotime() is used to convert... the return value. Here is the examples of strtotime() function: <?php echo
PHP is_executable() Function and example
Syntax bool is_executable(file_name) Find the PHP is_executable() function states whether the given file is executable or not Example of PHP is_executable Fu Code <?php     if (is_executable("c
PHP function ftruncate and example
Syntax int ftruncate(file_handle,length) ftruncate function truncates the file content with the given length. And it returns the truncated file size. PHP ftruncate() Function Example Code <?php $file1=fopen("bb.txt","r
php date function - Date Calendar
php date function  Hi, I am new to PHP. I am trying to get date from database. But, every time the date under 1970, it changes to 1970. Im...: 1960-12-02 (type is date ) In PHP : $dob= " 1960-12-02
The PHP fileatime() function , fileatime php, fileatime in php
Example of fileatime() function in PHP Description Syntax for fileatime() Function PHP int fileatime ( file_name ) It returns Last Access time in int... for fileatime() Function PHP <?php $time = time(); echo "current date
PHP function ftell() with example
Syntax int ftell(file_handle) ftell() function gives the current position of the file pointer. using the file handler in bytes. Example of PHP ftell() Function Code <?php $file=fopen("roseindia.txt","r"); echo ftell
PHP Implode() function
PHP implode() function In PHP, conversion of an array to string is done by implode() function. The implode() function puts the separator (In general we use... PHP implode() Function Example 1: <?php $array=array("Emp01"
Advertisements
 

 

 

DMCA.com