472,978 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,978 software developers and data experts.

Issue with popup calendar when clicking on dynamically created image

Hi,
Ineed some help from anyone regarding an issue I'm facing.
I've created an image dynamically on clicking a button.
What I inetend to do is when I click on the created image it will popup a calendar.
But the problem is that when I click on the button to create the image it automatically opoup the calendar before creating the image and giving an error "not Implemented" at newimg.onclick.
I'll really appreciate if anyone can help

here is the code I wrote :

Expand|Select|Wrap|Line Numbers
  1. var cellRight = row.insertCell(4);
  2. var el = document.createElement('input');
  3. el.type = 'text';
  4. el.name = 'textField' + button_Id + iteration + 3;
  5. el.id = 'textField' + button_Id + iteration + 3;
  6. el.size = 11;
  7. el.maxlength = 10;
  8. cellRight.appendChild(el);
  9.  
  10. //var cal = new CalendarPopup();
  11. // select cell
  12. var cellRight = row.insertCell(5);
  13. var newa = document.createElement('a');
  14. var newimg = document.createElement('img');
  15. newimg.src = '../images/dynCalendar.gif';
  16. newimg.name = 'anchor' + iteration;
  17. newimg.id = 'anchor' + iteration;
  18. newa.appendChild(newimg);
  19. newa.href = "#"; 
  20. cellRight.appendChild(newa);
  21. newimg.onclick = "cal.select(document.getElementById('textField' + button_Id + iteration + 3),'anchor' + iteration,'MM/dd/yyyy'); return false;";
Aug 6 '07 #1
1 1960
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

Please use CODE tags when posting code in future. Thanks.

Put the calendar call into a function and change the onclick to reference the function, but not call it, e.g.
Expand|Select|Wrap|Line Numbers
  1. newimg.onclick = someFunc;
Currently, what is happening is that you are running your code and assigning the result to the onclick.
Aug 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: chotiwallah | last post by:
i have a dynamically created image represented by an imagehandler, but i don't wanna output to the browser or a file. is it possible to read that image directly into a string? any help...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: Gopal Krish | last post by:
I'm have coded a simple menu (using link buttons as menu items) in a user control to be reused across many ASPX pages. In the page_load method I dynamically create the link buttons as follows ...
2
by: djc | last post by:
On the page_load event I am querying a database and binding data to some text boxes, list boxes, and a repeater control. When the page loads it uses the value of one of the database fields (status)...
4
by: Ali | last post by:
i am using visual studio 2005 and I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will...
0
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar"...
1
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar"...
4
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
6
by: -Lost | last post by:
Anyone know offhand how to center a text within the bounding box of an image (width-wise at least) without the Freetype library? GD- or ImageMagick-specifc code would do nicely. -- -Lost...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.