Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet how to add the calendar to the dynamic rows in html or jsp page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pradeep
how to add the calendar to the dynamic rows in html or jsp page
0 Answer(s)      4 years and 10 months ago
Posted in : JSP-Servlet




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>







Advertisement
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 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
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 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
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
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 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
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
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
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
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
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 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
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
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
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
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 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
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
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
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
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.*"%>
Dynamic html examples
Dynamic html examples  Hi, What is Dynamic HTML? Explain with dynamic html examples. Thanks   Hi, DHTML stands for Dynamic HTML and is uses the HTML, JavaScript, DOM, & CSS in a program. Following is very simple
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
Advertisements
 

 

 

DMCA.com