how to add the calendar to the dynamic rows in html or jsp page

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 button,adding the new empty row here so I need to enter the values . finaly we can save the 2 or more row values at a time but i need to add the calenadar for the date of payment column .My code is


<script>
function addRowToTable()
{
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);

// left cell

//cellLeft.appendChild(textNode);

// 1 cell
var cellRight = row.insertCell(0);
var el = document.createElement('input');
el.type = 'text';
el.name = 'check_dated';
el.id = 'check_dated';
datepicker="true";
datepicker_format="MM-DD-YYYY"
// el.value = 'check_dated';
el.setAttribute('check_dated', 'check_dated' + iteration);

el.size = 20;

//el.onkeypress = keyPressTest;
cellRight.appendChild(el);
// 2 cell
var cellRight = row.insertCell(1);
var el = document.createElement('input');
el.type = 'text';
el.name = 'amount_recdd' ;
el.id = 'amount_recdd';
//el.value = 'amount_recdd';
el.setAttribute('amount_recdd', 'amount_recdd' );
el.size = 20;

// el.onkeypress = keyPressTest;
cellRight.appendChild(el);
// 3 cell
var cellLeft = row.insertCell(2);
var textNode = document.createTextNode(iteration);
var cellRight = row.insertCell(2);
var el = document.createElement('input');
el.type = 'text';
el.name = 'check_nod';
el.id = 'check_nod' ;
// el.value = 'check_nod' ;
el.size = 20;

//el.onkeypress = keyPressTest;
cellRight.appendChild(el);
// select cell
/** var cellRightSel = row.insertCell(2);
var sel = document.createElement('select');
sel.name = 'selRow' + iteration;
sel.options[0] = new Option('text zero', 'value0');
sel.options[1] = new Option('text one', 'value1');
cellRightSel.appendChild(sel);**/
}
/**function keyPressTest(e, obj)
{
var validateChkb = document.getElementById('chkValidateOnKeyPress');
if (validateChkb.checked) {
var displayObj = document.getElementById('spanOutput');
var key;
if(window.event) {
key = window.event.keyCode;
}
else if(e.which) {
key = e.which;
}
var objId;
if (obj != null) {
objId = obj.id;
} else {
objId = this.id;
}
displayObj.innerHTML = objId + ' : ' + String.fromCharCode(key);
}
}**/
function removeRowFromTable()
{
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
if (lastRow > 1) tbl.deleteRow(lastRow - 1);
}
function openInNewWindow(frm)
{
// open a blank window
var aWindow = window.open('', 'TableAddRowNewWindow',
'scrollbars=yes,menubar=yes,resizable=yes,toolbar=no,width=400,height=400');

// set the target to the blank window
frm.target = 'TableAddRowNewWindow';

// submit
frm.submit();
}
function validateRow(frm)
{
var chkb = document.getElementById('chkValidate');
if (chkb.checked) {
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length - 1;
var i;
for (i=1; i<=lastRow; i++) {
var aRow = document.getElementById('check_nod' + i);
if (aRow.value.length <= 0) {
alert('Row ' + i + ' is empty');
return;
}
}
}
openInNewWindow(frm);
}

</script>








<table border="1" bgcolor="#9CC0FC" id="tblSample" cellspacing=0 width="100%" cellpadding=0 style="VERTICAL-ALIGN: middle">
<tr>
<td align="left" width="180" height="34" bgcolor="#9CC0FC" ><font face="TimesNewRoman" color="black" size=2>
<input type="text" length="25" name=check_dated value="<%=check_dated%>" id="check_dated" required="yes" >

</font> </td>

<td align="left" width="180" height="34" bgcolor="#9CC0FC" ><font face="TimesNewRoman" color="black" size=2>
<input type="text" length="25" name=amount_recdd value="<%=amount_recdd%>" required="yes" >

</font> </td>
<td align="left" width="180" height="34" bgcolor="#9CC0FC" ><font face="TimesNewRoman" color="black" size=2>
<input type="text" length="25" name=check_nod value="<%=check_nod%>" required="yes" >
</font> </td>
<td align="left" width="180" height="34" bgcolor="#9CC0FC" ><font face="TimesNewRoman" color="black" size=2>
<input type="button" value="Add" onclick="addRowToTable();" />
<input type="button" value="Delete" onclick="removeRowFromTable();" /> &nbsp;&nbsp;

</font> </td>

</tr>

<table>






View Answers









Related Tutorials/Questions & Answers:
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
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
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 page  My code is here now.When i click on calendar ,value.../Remove dynamic rows in HTML table window.history.forward(1
How to pass parametes from JSP page to HTML page? - JSP-Servlet
How to pass parametes from JSP page to HTML page?  Hi all, In my project I have one JSP page and one HTML page. In JSP page I have created HTML... with the username in HTML which I have called in JSP page. So I just want
How to add two calendars on the same html page
How to add two calendars on the same html page  I have used the same... use single calendar for a single html page.but while implementing two calendars on same html page it doesn't work..The first calendar works but the second
how to add dynamic data
how to add dynamic data  how to add dynamic data to an existing web application
Create dynamic page through JSP
Create dynamic page through JSP... how to create dynamic page. This code shows one by one record of student from... and showing the next record of database in JSP. <!DOCTYPE HTML PUBLIC "
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page  actually i have to create dynamic... page pe v r creating these dynamic number of drop down lists having name rating1
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... showlocation funtion to submitform.jsp page and display latitude value in jsp page
Include Static HTML Page in JSP
Include Static HTML Page in JSP   ... html page in jsp. In JSP, there are two ways to include another web resource. 1...;static.html" %> tag is used to include html page. The following
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 add dynamic table in java
How to add dynamic table in java  How to add dynamic table in java   import java.awt.*; import java.sql.*; import java.util.*; import javax.swing.*; import java.awt.event.*; import javax.swing.table.*; public class
JSP to add details to a database from a HTML form.
JSP to add details to a database from a HTML form.  Hi I'm a second year CS student who has to use JSP to validate a HTML form and add the details...; <%@ page contentType = "text/html" %> <%@ taglib uri="http
add same tables in jsp page
add same tables in jsp page  hi I have a table in my jsp page with data, now I want to add same copy of table without its default value in same page whenever I click add more table, how do I do
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
how to add Arraylist filter for a jsp page showing results from a servlet
how to add Arraylist filter for a jsp page showing results from a servlet  hello sir/mam, in my project i have an arraylist showing results in a jsp page table of given contents of database, i want to add a filter to it to show
Add/Remove Rows Dynamically with drop down list in html table using php
Add/Remove Rows Dynamically with drop down list in html table using php ... the following link: JSP Add Remove row using Javascript... Help? Dropdowndesign.php <html xmlns="http://www.w3.org/1999/xhtml">
how to retrieve text and images from mysql database and show on html page using jsp servlet
how to retrieve text and images from mysql database and show on html page using jsp servlet  <%@ page language="java" contentType="text/html... {color:blue} <%@ page import="java.sql.*" %> <%@ page import
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
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... and if i add more files to folder to 10 or any no than automatically the links
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... sample code for how to retrive array values from html to jsp.   hi friend
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
To get the value of more than one text box in an HTML page to a jsp page - JSP-Interview Questions
To get the value of more than one text box in an HTML page to a jsp page  An html file has a text box as To get the value of this text box in a JSP... the value of text boxes to a jsp page and how to access the same
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet
how to add the scrollbar to the pdf page when generating the pdf file from jsp  I am not able to see all the columns when i generated the pdf file from jsp.i have 12 colums so how to add the scrollbar
Count Rows - JSP-Servlet
Count Rows  How to count rows in Java. Thanks
How to redirect from a HTML page?
How to redirect from a HTML page?  Hi, Is it possible to redirect from HTML page to another page on the net? I have one page and I want to redirect... to redirect to another page using HTML code. You can use the following code: <meta
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
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 have one string that is as follows Dear ~2 , Your cl is ~3 ,el is ~4
How to add dynamically rows into database ?Need help pls
How to add dynamically rows into database ?Need help pls  Hi everyone, I really have a problem of insert multiple rows into the database.Now i can...; <input type="button" value="Add Row" onclick="addRow();" /> <input
jsp page to add users to mysql database
jsp page to add users to mysql database  <%@taglib uri="/WEB-INF..." %> <%@page contentType="text/html" pageEncoding="UTF-8"%>...-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Add
jsp page to add the user to mysql database
jsp page to add the user to mysql database  adduser.jsp: <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@taglib uri="/WEB-INF..." prefix="logic" %> <%@page contentType="text/html" pageEncoding="UTF-8
JSP:How to get year of system date - Date Calendar
JSP:How to get year of system date  Please tell me how to get year of system date; I am doing import java.util.*; Date d = new Date(); d.getYear... GetYear { public static void main(String []arg){ Calendar cal
html
html  How to add the calendar in html code
Introduction to JSP
applications. JSP makes it easy to mix static HTML parts with dynamic Java... dynamic web sites. JSP stands for Java Server Pages, a technology invented by Sun Microsystems to allow the easy creation of server side HTML pages. A JSP
Dynamic table in jsp
to show all values of excel file on jsp page in a table format. All elements are displaying on jsp page but in vertical line. How can i change them in table...Dynamic table in jsp  Hi..... I have a java file to read excel file
call a wep page using html - JSP-Interview Questions
call a wep page using html  Dear, Please I want to call a jsp page using a HTML Button called View. When the user click on it, a new JSP web page will opened. Can you help me please. Thanks in advance  Hi Friend
dynamic display - JSP-Servlet
javax.servlet.http.*; public class DataServlet extends HttpServlet{ String page="/jsp...dynamic display  hi, i want to display dynamic values in drop drown box in a jsp page.these values are in the form of arraylist's object which
dynamic pagination in jsp - JSP-Servlet
dynamic pagination in jsp  i am unable to display the data in multiple pages. I am gettting data from the database from the javaBeans to jsp by vectors... but i am unable to displaying them in jsp 15 records per page
How to make first JSP page?
How to make first JSP page?  Hello, How I can make first JSP page... tutorial: How to make my first JSP page? Thanks.... You can do it manually by creating a web application and then write jsp page
Displaying Rows - JSP-Servlet
Displaying Rows  Hi, I need your support on how to display data from ms sql 2000 database into an html form text box and text area, using java..., IOException{ response.setContentType("text/html"); PrintWriter out
Create Web Page with jsp
. For this we will create a simple dynamic JSP page with java.util.Date class (<... Web Page with jsp       In this example we will show you how to create first web page on tomcat
how to create web page on jsp?
how to create web page on jsp?  how to create web page on jsp
How to make first JSP page?
How to make first JSP page?  Hello, How I can make first JSP page? Thanks
jsp - Date Calendar
JSP page load error  Hi, I am getting error while loading the page in JSP. What could be the possible reason anyone
JSP: Dynamic Linking - JSP-Servlet
JSP: Dynamic Linking  Hi I am fetching data as a search result from... inside your result set loop to provide them a dynamic link. JSP Code...;Thank you for the answer. but how can i display all the details of that id
how to write a jsp form using html
how to write a jsp form using html  hi, i have written the code as below... but it is showing error. please help me how to resolve it. .html file...; </form> <p></body> </html> .jsp file <
Add year to Date without using Calendar in java
Add year to Date without using Calendar in java  how could i add a year to a date function without using calendar functions
JSP:Dynamic Linking - JSP-Servlet
JSP:Dynamic Linking  Hi This is extension to my previous question... details on next page ... How can i carry the id over to next page...  Hi... this.... " My actual question is how do i fetch rest all details of the id
how to add a update button in the following jsp
how to add a update button in the following jsp  Once the excel from the following jsp is loaded to the broswer, how to add a button in the jsp to allow the user to update the excel? thanks, <%@page import="java.io.*"%>

Ads