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
- var cellRight = row.insertCell(4);
- var el = document.createElement('input');
- el.type = 'text';
- el.name = 'textField' + button_Id + iteration + 3;
- el.id = 'textField' + button_Id + iteration + 3;
- el.size = 11;
- el.maxlength = 10;
- cellRight.appendChild(el);
- //var cal = new CalendarPopup();
- // select cell
- var cellRight = row.insertCell(5);
- var newa = document.createElement('a');
- var newimg = document.createElement('img');
- newimg.src = '../images/dynCalendar.gif';
- newimg.name = 'anchor' + iteration;
- newimg.id = 'anchor' + iteration;
- newa.appendChild(newimg);
- newa.href = "#";
- cellRight.appendChild(newa);
- newimg.onclick = "cal.select(document.getElementById('textField' + button_Id + iteration + 3),'anchor' + iteration,'MM/dd/yyyy'); return false;";