Calendar window is not showing the textbox values for the Dynamic rows in html page

Calendar window is not showing the textbox values for the Dynamic rows in html page

My code is here now.When i click on calendar ,value is not showing in textbox please help to me it is very urgent for me

<HTML>
<HEAD>

<TITLE> Add/Remove dynamic rows in HTML table </TITLE>
<script type="text/javascript" src="datepickercontrol.js"></script>
<link type="text/css" rel="stylesheet" href="datepickercontrol.css">
</script>
<script language="JavaScript" type="text/javascript">
window.history.forward(1);
</script>

<script language="JavaScript" src="calendar_us.js"></script>
<link rel="stylesheet" href="calendar.css">
<SCRIPT language="javascript">

function addRow(tableID) {



var table = document.getElementById(tableID);



var rowCount = table.rows.length;

var row = table.insertRow(rowCount);



var colCount = table.rows[0].cells.length;


for(var i=0; i<colCount; i++) {



var newcell = row.insertCell(i);



newcell.innerHTML = table.rows[0].cells[i].innerHTML;

//alert(newcell.childNodes);

switch(newcell.childNodes[0].type) {

case "text":

newcell.childNodes[0].value = "";

break;

case "checkbox":

newcell.childNodes[0].checked = false;

break;

case "select-one":

newcell.childNodes[0].selectedIndex = 0;

break;

}

}

}



function deleteRow(tableID) {

try {

var table = document.getElementById(tableID);

var rowCount = table.rows.length;



for(var i=0; i<rowCount; i++) {

var row = table.rows[i];

var chkbox = row.cells[0].childNodes[0];

if(null != chkbox && true == chkbox.checked) {

if(rowCount <= 1) {

alert("Cannot delete all the rows.");

break;

}

table.deleteRow(i);

rowCount--;

i--;

}



}

}catch(e) {

alert(e);

}

}



</SCRIPT>
<script language="JavaScript">

//Script by Denis Gritcyuk: [email protected]
// Title: Timestamp picker
// Description: See the demo at url
// URL: http://us.geocities.com/tspicker/
// Version: 1.0
// Date: 12-05-2001 (mm-dd-yyyy)
// Author: Denis Gritcyuk <[email protected]>; <[email protected]>
// Notes: Permission given to use this script in any kind of applications if
// header lines are left unchanged. Feel free to contact the author
// for feature requests and/or donations

function show_calendar(str_target, str_datetime) {
var arr_months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
var week_days = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
var n_weekstart = 1; // day week starts from (normally 0 or 1)

var dt_datetime = (str_datetime == null || str_datetime =="" ? new Date() : str2dt(str_datetime));
var dt_prev_month = new Date(dt_datetime);
dt_prev_month.setMonth(dt_datetime.getMonth()-1);
var dt_next_month = new Date(dt_datetime);
dt_next_month.setMonth(dt_datetime.getMonth()+1);
var dt_firstday = new Date(dt_datetime);
dt_firstday.setDate(1);
dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
var dt_lastday = new Date(dt_next_month);
dt_lastday.setDate(0);

// html generation (feel free to tune it for your particular application)
// print calendar header
var str_buffer = new String (
"<html>\n"+
"<head>\n"+
" <title>Calendar</title>\n"+
"</head>\n"+
"<body bgcolor=\"White\">\n"+
"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
"<tr><td bgcolor=\"#4682B4\">\n"+
"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
"<tr>\n <td bgcolor=\"#4682B4\"><a href=\"javascript:window.opener.show_calendar('"+
str_target+"', '"+ dt2dtstr(dt_prev_month)+"'+document.cal.time.value);\">"+
"<img src=\"prev.gif\" width=\"16\" height=\"16\" border=\"0\""+
" alt=\"previous month\"></a></td>\n"+
" <td bgcolor=\"#4682B4\" colspan=\"5\">"+
"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\">"
+arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</font></td>\n"+
" <td bgcolor=\"#4682B4\" align=\"right\"><a href=\"javascript:window.opener.show_calendar('"
+str_target+"', '"+dt2dtstr(dt_next_month)+"'+document.cal.time.value);\">"+
"<img src=\"next.gif\" width=\"16\" height=\"16\" border=\"0\""+
" alt=\"next month\"></a></td>\n</tr>\n"
);

var dt_current_day = new Date(dt_firstday);
// print weekdays titles
str_buffer += "<tr>\n";
for (var n=0; n<7; n++)
str_buffer += " <td bgcolor=\"#87CEFA\">"+
"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\">"+
week_days[(n_weekstart+n)%7]+"</font></td>\n";
// print calendar table
str_buffer += "</tr>\n";
while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
dt_current_day.getMonth() == dt_firstday.getMonth()) {
// print row heder
str_buffer += "<tr>\n";
for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
if (dt_current_day.getDate() == dt_datetime.getDate() &&
dt_current_day.getMonth() == dt_datetime.getMonth())
// print current date
str_buffer += " <td bgcolor=\"#FFB6C1\" align=\"right\">";
else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
// weekend days
str_buffer += " <td bgcolor=\"#DBEAF5\" align=\"right\">";
else
// print working days of current month
str_buffer += " <td bgcolor=\"white\" align=\"right\">";

if (dt_current_day.getMonth() == dt_datetime.getMonth())
// print days of current month
str_buffer += "<a href=\"javascript:window.opener."+str_target+
".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close();\">"+
"<font color=\"black\" face=\"tahoma, verdana\" size=\"2\">";
else
// print days of other months
str_buffer += "<a href=\"javascript:window.opener."+str_target+
".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close();\">"+
"<font color=\"gray\" face=\"tahoma, verdana\" size=\"2\">";
str_buffer += dt_current_day.getDate()+"</font></a></td>\n";
dt_current_day.setDate(dt_current_day.getDate()+1);
}
// print row footer
str_buffer += "</tr>\n";
}
// print calendar footer
str_buffer +=
"<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#87CEFA\">"+
"<font color=\"White\" face=\"tahoma, verdana\" size=\"2\">"+
"Time: <input type=\"text\" name=\"time\" value=\""+dt2tmstr(dt_datetime)+
"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
"</table>\n" +
"</tr>\n</td>\n</table>\n" +
"</body>\n" +
"</html>\n";

var vWinCal = window.open("", "Calendar",
"width=200,height=250,status=no,resizable=yes,top=200,left=200");
vWinCal.opener = self;
var calc_doc = vWinCal.document;
calc_doc.write (str_buffer);
calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) {
var re_date = /^(\d+)\-(\d+)\-(\d+)\s+(\d+)\:(\d+)\:(\d+)$/;
if (!re_date.exec(str_datetime))
return alert("Invalid Datetime format: "+ str_datetime);
return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1, RegExp.$4, RegExp.$5, RegExp.$6));
}
function dt2dtstr (dt_datetime) {
return (new String (
dt_datetime.getDate()+"-"+(dt_datetime.getMonth()+1)+"-"+dt_datetime.getFullYear()+" "));
}
function dt2tmstr (dt_datetime) {
return (new String (
dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}



</script>
</HEAD>
<BODY>
<form name="tstest" >


<INPUT type="button" value="Add Row" onclick="addRow('dataTable')" />



<INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" />



<TABLE id="dataTable" width="350px" border="1">

<TR>

<TD><INPUT type="checkbox" name="chk"/></TD>

<TD><input type="Text" name="timestamp" value="">
<a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a></TD>

<TD>

<SELECT name="country">

<OPTION value="in">India</OPTION>

<OPTION value="de">Germany</OPTION>

<OPTION value="fr">France</OPTION>

<OPTION value="us">United States</OPTION>

<OPTION value="ch">Switzerland</OPTION>

</SELECT>

</TD>

</TR>

</TABLE>
</form>

</BODY>
</HTML>
View Answers









Related Tutorials/Questions & Answers:
Calendar window is not showing the textbox values for the Dynamic rows in html page - Java Interview Questions
Calendar window is not showing the textbox values for the Dynamic rows in html... is not showing in textbox please help to me it is very urgent for me Add/Remove dynamic rows in HTML table window.history.forward(1
Calendar window is not coming for the Dynamic rows in html page - JSP-Servlet
Calendar window is not coming for the Dynamic rows in html page  Calendar window is not coming for the Dynamic rows in html page. I have 3 textboxes. one column is having the date textbox .I need to add the calendar icon
Advertisements
how to add the calendar to the dynamic rows in html or jsp page - JSP-Servlet
how to add the calendar to the dynamic rows in html or jsp page   Hi Sir, i have 3 columns in my jsp page date of payment,amount recieved,no and i have 2 button in my jsp page ADD and delete button. when i click on add
How to insert dynamic textbox values into database using Java?
How to insert dynamic textbox values into database using Java?  Hi I am trying to insert dynamic textbox values to database, my jsp form have 2... these dynamic textbox values to database(Oracle 11g)...Please help me out. I have
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i give some input in a textbox and click on a add link. It should be added
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i give some input in a textbox and click on a add link. It should be added
showing the information of database in textbox
showing the information of database in textbox  how to make a information of a database make appear to the user in the textbox
retaining textbox values
retaining textbox values  i have a calculator program, when i press a button the value displays but disappears when i press another button so how can i keep values to display when i press multiple buttons
how to pass form values from javascript of html page to jsp page
how to pass form values from javascript of html page to jsp page   This is my sample html page which contains inline javascript which calculates... to submit all the form values with lattitude and longitude returned from
passing textbox value from one page to another page using html n javascript
passing textbox value from one page to another page using html n... of variable at onclick event of button and also want to print it in textbox on the othe (next/prevoious)page please help me   1)page1.html: <html>
get date picker values to a textbox
get date picker values to a textbox  I am using DatePicker to select date in a form in asp.net using c#. I need the picked data to get in to a textbox. Please help me soon
Passing values from child window to parent window.
Passing values from child window to parent window.  Hai, I'm having... check boxes those check box values should be shown in the parent window,which will have some more values in it.The values which are selected from child window
store dynamic generated textbox value into database
store dynamic generated textbox value into database  sir, how do i store dynamically generated textbox value into the database thanks in advance
Passing values from child window to parent window.
Passing values from child window to parent window.  http://www.roseindia.net/java/pass-value-example/pass-value-child-to-parent.shtml I have gone thru the link but my requirement is checkboxes.can u please explain
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
Pass value from child to parent window
Pass value from child to parent window       Java example program to pass value from child window to parent window We can pass values from a child window in Html to the parent
Hiding and showing elements on the page
Hiding and showing elements on the page       Hiding and showing elements on the page... the text by button click : jqHIdeShowText . html
ModuleNotFoundError: No module named 'dynamic-window-approach'
ModuleNotFoundError: No module named 'dynamic-window-approach'  Hi...: No module named 'dynamic-window-approach' How to remove the ModuleNotFoundError: No module named 'dynamic-window-approach' error? Thanks   
ModuleNotFoundError: No module named 'dynamic-window-approach'
ModuleNotFoundError: No module named 'dynamic-window-approach'  Hi...: No module named 'dynamic-window-approach' How to remove the ModuleNotFoundError: No module named 'dynamic-window-approach' error? Thanks   
ModuleNotFoundError: No module named 'dynamic-window-approach'
ModuleNotFoundError: No module named 'dynamic-window-approach'  Hi...: No module named 'dynamic-window-approach' How to remove the ModuleNotFoundError: No module named 'dynamic-window-approach' error? Thanks   
Dynamic html examples
Dynamic html examples  Hi, What is Dynamic HTML? Explain with dynamic html examples. Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, DHTML stands for Dynamic HTML and is uses the HTML
Retaining textBox values in java - Java Beginners
Retaining textBox values in java  Hi all, i have a jsp screen where i have two actions . I have a single textbox and two buttons. My textbox value is becoming null once i click on any one button. I want the textbox value
i want to create dynamic calendar in java
i want to create dynamic calendar in java  i want code and explanation
i want to create dynamic calendar in java
i want to create dynamic calendar in java  i want code and explanation
Dynamic HREF link - Date Calendar
Dynamic HREF link  Hi, I want to know how to create a page with links to download the files present in one folder and if the no of files present in the folder changes the link for downloading changes automatically. For eg
date in textbox on page load
date in textbox on page load   i want to insret the current date in textbox but this code dosen't work and the value of text box will be blank... into textbox on page load. <html> <script> function addDate(){ date = new
How to display current date in textbox - Date Calendar
;% } This is my problem: I want to display current date in textbox... show in textbox. Please help me to solve that problem, I will wait your answer
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file  Hi am new to java. i need to create a dynamic web application. Am using eclipse IDE and Apache tomcat server. i need
JSP textbox autopopulation on basis of SQL table values
JSP textbox autopopulation on basis of SQL table values  Hi, I need to achieve the following on J2EE platform Could you please help? The following table is created in MySQL DB: Problem type Status Responsible LEGAL
static page and dynamic pages?
static page and dynamic pages?  what is the diff between static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages adv and disadv
To put a "close window" link on a page?
To put a "close window" link on a page?  To put a "close window" link on a page
Printing Values of Resultset to Html Table
in advance   JSP Display values of ResultSet to HTML table: <%@page...Printing Values of Resultset to Html Table  I have a resultset and I need to collect the resultset values into the arraylist into a table
Populate value into HTML page
Populate value into HTML page  Hi, How to populate values from one html page table to another html page..? Thanks
How to insert data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB:student; @table:stu_info; Combobox values:(class1,class2,class3); textbox1
how to get the values from dynamically generated textbox in java?
how to get the values from dynamically generated textbox in java?  I... as per the retrieved data) and I want to store textbox values into the two table... to get and update this textbox values into both the tables(Xray,CTScan
dynamic multiplecheckbox values insertion - JSP-Servlet
dynamic multiplecheckbox values insertion  hi How to insert dynamically generated checkbox values to store in mysql data base using jsp?  Hi Friend, Try the following code: 1)checkbox.jsp: Name
Autopopulate values into textbox from database on pressing tab or on clicking
Autopopulate values into textbox from database on pressing tab or on clicking  Hi, In my project we have to enter a productid which is first need... on the producttype(which is first textbox related to product_id).This is need
how to store a dynamic values - JSP-Servlet
how to store a dynamic values  Dear sir, i have a ArrayList in that i have stored a values from a excel sheet specified column values and i... and bonus is ~5 . Thanks Hr in another arraylist i have a values ~2,~3
Populate values from html to another html
Populate values from html to another html In this tutorial, you will learn how to send values from one html page to another. Here, we have create a html... on another html page. page1.html: <html> <form type=get action="
How to retrieve array values from html form to jsp?
How to retrieve array values from html form to jsp?  Hi! I am developing an dynamic user interface. I hv developed html forms and i wat to convert it into jsp. Means i just want to retrieve values from html form containing array
how to Insert Array Values Into Separate Rows using java?
how to Insert Array Values Into Separate Rows using java?  how to Insert Array Values Into Separate Rows using java?  class InsertArrayValuesInSeparateRow{ public static void main(String[] args
display all the values on next page
when i return on first page it should display my selected values in textbox... values are inserting in the database and i am moving on another page after...display all the values on next page  i am inserting values
problem in sending more than 500 values to a jsp page
problem in sending more than 500 values to a jsp page  when i am trying to send more than 500 values from a html form to a jsp page browser is showing that server is not sending any data...I have configured tomcat5.5
how to fetch values from .properties to a html file
how to fetch values from .properties to a html file  I have a .properties file with some key value pairs in it. I need to fetch the values from this .properties file into a html file.Please let me know how to do
inserting all the values in a html table column
inserting all the values in a html table column  strong text hai everyone, i'm a fresher to servlet i need to know that, how can i insert all the values in a html table column into a database. Thanks in advance
simplest HTML page
simplest HTML page  What is the simplest HTML page
html-jsp
html-jsp  If i want to get dynamic value in html textbox or in jsp,then how can I get the value,how the value will be transfered from servlet page to the html textbox.Thanx in advance.....Kindly help me
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE ... Roleid and Role_name. and values are Roleid Role_name 1 SystemAdmin 2 Office Bearer Am loading this Rolename into one page called

Ads