SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    On click of image button

    Dear All,
    I have found a javascript for datepicker at this site http://javascriptcalendar.org/javasc...ate-picker.php. My only problem now I dont want the datepicker to appear when I click in the input box but beside that I want to have a small calendar image and upon clicking only I want the the pop-up to appear. What must I modify to make it work? Thank you.

    I tried someting below
    <body>

    <input type="text" size="12" id="inputField" /><img src="pick.jpg" onSelect="pickDate">

    </body>
    function pickDate()
    {
    gDate =new JsDatePick{
    useMode:2,
    target:"inputField",
    dateFormat:"%d-%M-%Y"
    /*selectedDate:{ This is an example of what the full configuration offers.
    day:5, For full documentation about these settings please see the full version of the code.
    month:9,
    year:2006
    },
    yearsRange:[1978,2020],
    limitToToday:false,
    cellColorScheme:"beige",
    dateFormat:"%m-%d-%Y",
    imgPath:"img/",
    weekStartDay:1*/
    };
    };

  2. #2
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think <img> has an onselect event.

    try
    Code:
    <img src="pick.jpg" alt="" onclick="pickDate();" />

  3. #3
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Kalon,
    Below is my codes. The problem now the image is not appearing one thing secondly I get this error missing ; before statement gDate =new JsDatePick{

    <!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>jsDatePick Javascript example</title>

    <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />

    <script type="text/javascript" src="jsDatePick.min.1.3.js"></script>

    <script type="text/javascript">
    function pickDate()
    {
    gDate =new JsDatePick{
    useMode:2,
    target:"inputField",
    dateFormat:"%d-%M-%Y"
    /*selectedDate:{ This is an example of what the full configuration offers.
    day:5, For full documentation about these settings please see the full version of the code.
    month:9,
    year:2006
    },
    yearsRange:[1978,2020],
    limitToToday:false,
    cellColorScheme:"beige",
    dateFormat:"%m-%d-%Y",
    imgPath:"img/",
    weekStartDay:1*/
    };
    };
    </script>
    </head>
    <body>

    <input type="text" size="12" id="inputField" /><img src="btn.png" onClick="pickDate">

    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •