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

Ads
 

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

Ads









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
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
Advertisements
how to add dynamic data
how to add dynamic data  how to add dynamic data to an existing web application
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
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
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... of database in JSP. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
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...; tag is used to include html page. The following includeStatic.jsp page shows
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
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
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 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.*"%>
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
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
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 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
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
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
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
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
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
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
how to set time in jsp page
how to set time in jsp page   I need code for set the time in jsp code .iam using struts frame work back end oracle 10g ide is eclipse 6.0
How to use Jquery in jsp page
How to use Jquery in jsp page  Hello Sir, I am... in my jsp page. I have heard that jquery will be usefull for this work. According to my need in my gridview i have to add following functionaliies
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 <
how to redirect jsp page to extjs
how to redirect jsp page to extjs   my requirement is redirect jsp page to extjs form. Am using spring mvc...my welcome page is index.jsp from that index.jsp i need to redirect to extjs. can any one help me in this thanks
how to insert data in database using html+jsp
how to insert data in database using html+jsp  anyone know what... method="post" action="http://localhost:8080/examples/jsp/insert.jsp"> <...; </form> </html> 2)insert.jsp: <%@page import="java.sql.
how to add pageup page down functionality in scrolpane
how to add pageup page down functionality in scrolpane  how to add pageup page down functionality in scrolpane. In my GUI untill i dont click on screen area , the page up & pagedown button not works . what should i do to make
how to add web cam in web page
how to add web cam in web page  how do i embed my webcam in web page. code for embedding web cam in web page
How To Include Two Jsp page in another jsp page?
How To Include Two Jsp page in another jsp page?  I use following code to Include Two Jsp Page Header and footer <%@include file="header.jsp... in page How can i Display at correct position?   Please visit

Ads