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();" />
</font> </td>
</tr>
<table>
View Answers
Related Tutorials/Questions & Answers:
Advertisements
How to add two calendars on the same html pageHow 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
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 "
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-jsphtml-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 javaHow 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 pageadd 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 HREF link - Date CalendarDynamic 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 examplesDynamic 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 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 store a dynamic values - JSP-Servlethow 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
jsp page to add users to mysql databasejsp 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 databasejsp 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 CalendarJSP:
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
htmlhtml
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 Questionscall 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-Servletdynamic 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-ServletDisplaying 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
jsp - Date CalendarJSP 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-ServletJSP:
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 htmlhow 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
<
JSP:Dynamic Linking - JSP-ServletJSP:
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 jsphow 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.*"%>