Note that there are some explanatory texts on larger screens.

plurals
  1. POimplement listener
    primarykey
    data
    text
    <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt; &lt;title&gt;YUI Calendar Control Example&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="yui/build/calendar/assets/skins/sam/calendar.css"&gt; &lt;script type="text/javascript" src="yui/build/yahoo-dom-event/ yahoo-dom-event.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="yui/build/calendar/calendar-min.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; input { margin:0px 10px 0px 10px; } &lt;/style&gt; &lt;/head&gt; &lt;body class="yui-skin-sam"&gt; &lt;div&gt; &lt;label&gt;Please enter your date of birth:&lt;/label&gt; &lt;input type="text" name="dobfield" id="dobfield"&gt; &lt;img id="calico" src="E:\HP_PROJECT\cal.png" alt="Open the Calendar control"&gt; &lt;/div&gt; &lt;div id="mycal"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; //create the namespace object for this example YAHOO.namespace("yuibook.calendar"); //define the lauchCal function which creates the calendar YAHOO.yuibook.calendar.launchCal = function() { //create the calendar object, specifying the container Var myCal = new YAHOO.widget.Calendar("mycal"); //draw the calendar on screen myCal.render(); } //define the showCal function which shows the calendar Var showCal = function() { //show the calendar myCal.show(); } //create calendar on page load YAHOO.util.Event.onDOMReady(YAHOO.yuibook.calendar.launchCal); //attach listener for click event on calendar icon YAHOO.util.Event.addListener("calico", "click", showCal); //myCal.hide(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I have used the above code. But the problem with the code is that when I click image icon nothing is displayed. I am new to javascript. Please help me how to implement listener.</p> <p>Please guide me where to do chages in the code.</p> <p>Thanks Padmaja</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload