Loading ...
Sorry, an error occurred while loading the content.

Re: calendar.render() prevents filling a testbox

Expand Messages
  • jhilden007
    Dav, thank you very much you were absolutly correct. Making your one line change seems to have fixed everything!!!! You rock! ... textbox_name+ _container ,
    Message 1 of 3 , Dec 12, 2006
    • 0 Attachment
      Dav, thank you very much you were absolutly correct. Making your one
      line change seems to have fixed everything!!!!

      You rock!

      --- In ydn-javascript@yahoogroups.com, dav.glass@... wrote:
      >
      > Change this line:
      > YAHOO.widget.Calendar(textbox_name,textbox_name+"_container",
      > {title:"Choose a date:", close:true});
      >
      > To this:
      >
      > YAHOO.widget.Calendar(textbox_name + '_calendar',
      textbox_name+"_container",
      > {title:"Choose a date:", close:true});
      >
      > The first parameter passed to the Calendar constructor is the id.
      > id is the ID that should be assigned to the Calendar
      > instance's table element (the table will be created by the Calendar
      > instance when it is rendered);
      >
      > So the table that contains the calendar was getting the same id as
      the text input, so after the calendar was rendered javascript couldn't
      access the old id.
      >
      > Hope that helps..
      >
      > Dav
      >
      >
      > Dav Glass
      > dav.glass@...
      > davglass.com
      > 618.694.3476
      >
      > + Windows: n. - The most successful computer virus, ever. +
      > + A computer without a Microsoft operating system is like a dog
      > without bricks tied to its head +
      > + A Microsoft Certified Systems Engineer is to computing what a
      > McDonalds Certified Food Specialist is to fine cuisine +
      >
      > ----- Original Message ----
      > From: jhilden007 <jayhilden@...>
      > To: ydn-javascript@yahoogroups.com
      > Sent: Monday, December 11, 2006 11:50:31 AM
      > Subject: [ydn-javascript] calendar.render() prevents filling a testbox
      >
      > I have a very simple script that opens the calendar and right after
      > the calendar is rendered is populates a textbox right next to the
      > calendar with a value.
      >
      > The issue I'm having is that if I populate the textbox before I render
      > the calendar everything is cool; but right after the calendar is
      > rendered I am unable to populate the field.
      >
      > The code is below, any help would be much appreciated.
      >
      >
      > /****************************************************************/
      > <html>
      > <script type="text/javascript"
      > src="./js/Yahoo_Calendar/yahoo.js"></script>
      > <script type="text/javascript"
      src="./js/Yahoo_Calendar/dom.js"></script>
      > <script type="text/javascript"
      > src="./js/Yahoo_Calendar/event.js"></script>
      > <script type="text/javascript"
      > src="./js/Yahoo_Calendar/calendar.js"></script>
      > <link rel="stylesheet" type="text/css"
      > href="./js/Yahoo_Calendar/assets/calendar.css" />
      > <script>
      > var calendar = null;
      > function display_calendar(textbox_name) {
      > if (calendar) {
      > calendar.show();
      > } else {
      > calendar = new
      > YAHOO.widget.Calendar(textbox_name,textbox_name+"_container",
      > {title:"Choose a date:", close:true});
      > document.getElementById(textbox_name).value = "test1";//THIS
      WORKS FINE
      > calendar.render();
      > document.getElementById(textbox_name).value = "test2"; //WHY
      DOESN'T
      > THIS WORK?!?!@??!
      > //calendar.hide();
      > //document.getElementById(textbox_name).value = "test3"; //WHY
      > DOESN'T THIS WORK?!?!@??!
      > }
      > };
      >
      > </script>
      > <body>
      > <div id="date_container"></div>
      > <input type="textbox" name="date" id="date"/>
      > <input type="button" name="show_calendar" value="Show Calendar"
      > onClick="display_calendar('date');"/>
      > </body>
      > </html>
      > /****************************************************************/
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.