473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issue with popup calendar when clicking on dynamically created image

1 New Member
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 2002
acoder
16,027 Recognized Expert Moderator MVP
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
1533
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 appreciated, micha
2
2929
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 a WebForm with some textboxes, dropdownlists, a panel, imagebutton and so on. When I click on the image button (which was created at design time) I dynamically build a table. In each of row of that new table I put several cells and one cell...
1
2590
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 LinkButton myLB = new LinkButton(); ......... .........
2
1949
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) to determine what options should be available for this particular item (which is an issue... small issue tracking system). Each of these options is an action that may be performed on the issue and I am dynamically creating LinkButtons for each...
4
10018
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 then be passed back to the main form and populate a textbox. it works fine. but when i used master page for all my pages and i put the textbox inside the content , the calender pops up but when i select the date nothing happens .. the textbox was...
0
1720
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" OnClientClick= "window.open('Calendar.aspx', 'Calendar', 'menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, width=200, height=200');" />
1
2735
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" OnClientClick= "window.open('Calendar.aspx', 'Calendar', 'menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, width=200, height=200');" />
4
2967
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 that date. You were able to use the icon (button) on multiple text boxes on the form. I have lost the link and can't find any reference to it on my machine. Could someone lead me in the right direction? Thank you.
6
4745
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 Remove the extra words to reply by e-mail. Don't e-mail me. I am kidding. No I am not.
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.