javascript
thanks ..
but i hav writen code in diferent way can u mak changes in tis code
here only 1 row is getting inserted into database but i want all the rows to get inserted into database
anoter.asp
<html>
<head>
<script langauge='javascript' type='text/javascript'>
function addNew() {
var mainContainer = document.getElementById('mainContainer');
var newDiv = document.createElement('div');
var product_id = document.createElement('input');
product_id.id="product_id";
product_id.type = "text";
product_id.size=13;
product_id.name="product_id";
var pro_desc = document.createElement('input');
pro_desc.type="text";
pro_desc.id="pro_desc";
pro_desc.size=13;
pro_desc.name="pro_desc";
var stocks= document.createElement('input');
stocks.type="text";
stocks.id="stocks";
stocks.size=13;
stocks.name="stocks";
var price= document.createElement('select');
price.id="price";
//price.type ="SELECT";
//price.value = "1";
// price.Add('100','200');
// price.value=100;
// price.value=200;
var newDelButton = document.createElement('input');
newDelButton.type ="button";
newDelButton.value = "Delete";
var newsaveButton = document.createElement('input');
newsaveButton.type ="button";
newsaveButton.value = "save";
var neweditButton = document.createElement('input');
neweditButton.type ="button";
neweditButton.value = "edit";
newDiv.appendChild(product_id);
newDiv.appendChild(pro_desc);
newDiv.appendChild(stocks);
newDiv.appendChild(price);
newDiv.appendChild(newDelButton);
newDiv.appendChild(newsaveButton);
newDiv.appendChild(neweditButton);
mainContainer.appendChild(newDiv);
newDelButton.onclick = function() {
mainContainer.removeChild(newDiv);
}
newsaveButton.onclick=function(){
document.getElementById('product_id').style.visibility='hidden';
document.getElementById('pro_desc').style.visibility='hidden';
document.getElementById('stocks').style.visibility='hidden';
document.getElementById('price').style.visibility='hidden';
}
neweditButton.onclick=function()
{
document.getElementById('product_id').style.visibility='visible';
document.getElementById('pro_desc').style.visibility='visible';
document.getElementById('stocks').style.visibility='visible';
document.getElementById('price').style.visibility='visible';
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="abc.asp" >
<input type="hidden" name="psize" id="psize">
<table border="1" id="ptablePerson" align="center">
<table BorderStyle="none">
<tr>
<td><h3> product id </h3></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><h3> product desc</h3></td>
<td></td>
<td></td>
<td></td>
<td><h3> stocks </h3>
<h3>avalilable</h3></td>
</tr>
</table>
<div id="mainContainer">
<td><div><input name="newButton" type="button" value="Add" onclick=addNew()></div></td>
</div>
<input type="submit" value="submit" >
</form>
</body>
</html>
abc.asp
<html>
<head>
<script langauge='javascript' type='text/javascript'>
function addNew() {
var mainContainer = document.getElementById('mainContainer');
var newDiv = document.createElement('div');
var product_id = document.createElement('input');
product_id.id="product_id";
product_id.type = "text";
product_id.size=13;
product_id.name="product_id";
var pro_desc = document.createElement('input');
pro_desc.type="text";
pro_desc.id="pro_desc";
pro_desc.size=13;
pro_desc.name="pro_desc";
var stocks= document.createElement('input');
stocks.type="text";
stocks.id="stocks";
stocks.size=13;
stocks.name="stocks";
var price= document.createElement('select');
price.id="price";
//price.type ="SELECT";
//price.value = "1";
// price.Add('100','200');
// price.value=100;
// price.value=200;
var newDelButton = document.createElement('input');
newDelButton.type ="button";
newDelButton.value = "Delete";
var newsaveButton = document.createElement('input');
newsaveButton.type ="button";
newsaveButton.value = "save";
var neweditButton = document.createElement('input');
neweditButton.type ="button";
neweditButton.value = "edit";
newDiv.appendChild(product_id);
newDiv.appendChild(pro_desc);
newDiv.appendChild(stocks);
newDiv.appendChild(price);
newDiv.appendChild(newDelButton);
newDiv.appendChild(newsaveButton);
newDiv.appendChild(neweditButton);
mainContainer.appendChild(newDiv);
newDelButton.onclick = function() {
mainContainer.removeChild(newDiv);
}
newsaveButton.onclick=function(){
document.getElementById('product_id').style.visibility='hidden';
document.getElementById('pro_desc').style.visibility='hidden';
document.getElementById('stocks').style.visibility='hidden';
document.getElementById('price').style.visibility='hidden';
}
neweditButton.onclick=function()
{
document.getElementById('product_id').style.visibility='visible';
document.getElementById('pro_desc').style.visibility='visible';
document.getElementById('stocks').style.visibility='visible';
document.getElementById('price').style.visibility='visible';
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="abc.asp" >
<input type="hidden" name="psize" id="psize">
<table border="1" id="ptablePerson" align="center">
<table BorderStyle="none">
<tr>
<td><h3> product id </h3></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><h3> product desc</h3></td>
<td></td>
<td></td>
<td></td>
<td><h3> stocks </h3>
<h3>avalilable</h3></td>
</tr>
</table>
<div id="mainContainer">
<td><div><input name="newButton" type="button" value="Add" onclick=addNew()></div></td>
</div>
<input type="submit" value="submit" >
</form>
</body>
</html>
View Answers
January 13, 2010 at 11:31 AM
Hi Friend,
Please send your full code.
Thanks
Related Tutorials/Questions & Answers:
javascriptjavascript
javascript code to dynamically add table on button click.../
javascript/javascriptexamples/
javascript-add-row-dynamically.shtml
http://www.roseindia.net/
javascript/
javascript-add-row-to-table.shtml
http://www.roseindia.net
Advertisements
JavascriptJavascript How validations are done using
javascript ,with example? and interview questions on
javASCRIPT JavaScript should use
JavaScript?
Thanks
Hi,
JavaScript is scripting language that runs on browser. You have to embed
JavaScript in HTML page.
Please see
JavaScript tutorial.
Thanks
JavaScriptJavaScript how to get full path of a file type in
javascript javascriptjavascript Hi deepak,
how to write form validation on
javascript javascriptjavascript write a program to display implement about browsers using
javascript javaScriptjavaScript How to open a browser window that cannot be resized? (HTML +
Javascript javascriptjavascript i have just learned
javascript...
can you tell me what kind of applications can be made by
javascript??
thank you
javascriptjavascript how to set the request or session attribute in
javascript head part of jsp page
javascriptjavascript Hi sir,
This is sinduri, i want to learn
javascript, so plz can u help me.how to learn
javascriptjavascript hi sir,
if i want to learn
javascript. what concepts i want to know
JAVASCRIPTJAVASCRIPT I have one textbox and I want to validate that it must start with number(1-0). can anyone tell me a
javascript for that ?
thanks in advance
Javascript Javascript Javascript to check Numeric entry in checkbox.....
Hi Please find the following code for numeric entry validation in
javascript
function validateBox(){
var data=document.myForm.someText.value
javascriptjavascript hi, I was actually working on to calculate the number of days between two dates of yyyy-mm-dd format using
javascript, and when i click on button then number of days should be display in textbox
javaScriptjavaScript . Print a table like below in
JAVASCRIPT
5 x 1 = 5
5 x 2 = 10
���.
5 x 20 = 100
javascriptjavascript passing
javascript values to jsp
Hi Friend,
Try the following code:ADS_TO_REPLACE_1
form.jsp:
<html>
<script>...
Javascript value In JSP">
<%
String st=request.getParameter("msg");
if(st
Javascript this format xxx-xxx-xxxx, i want the code in
javascript. as a function.
Javascript Phone Number Validation
<html>
<script>
function..." method="post" onsubmit="
javascript:return validate();">
Phone Number:<
JavascriptJavascript Dear Sir,
Thank You a lot for your continuos support.Again i am in need of your help.
What is the
javascript code to disable a link,once...
javascript or css
Please help me.Urgent
Regards
Debasis
Hello Friend
JavascriptJavascript <html>
<head>
<script type="text/
javascript">
function validateForm() {
var sname=document.getElementById('spocname');
var scontact=document.getElementById('spoccontact');
if(sname.value.length
javascriptjavascript how to create random question using
javascript?
<html>
<script>
function displayQuestions() {
document.getElementById("text").value=" ";
var Questions = new Array(20
javascriptjavascript Hi deepak,
sample example on
javascript form validation
<html>
<script>
function checkName(text) {
if(isNaN(text)){
return 1;
}
else{
alert("Please enter a valid name. The only charachters
javascript doubtjavascript doubt How to retrieving the values from Database by using
javascript javascript validationjavascript validation validation of comparing dropdownlist and textbox in
javascript JavaScript - JavaScript Tutorial
JavaScript Tutorials is one of the best Quick
reference to the
JavaScript. In this
JavaScript reference you will find most of
the things about java script.
JavaScript tutorial is classified into sections
with examples. This tutorial
JavaScript - JavaScript Tutorial
JavaScript Tutorials is one of the best Quick
reference to the
JavaScript. In this
JavaScript reference you will find most of
the things about java script.
JavaScript tutorial is classified into sections
with examples. This tutorial
javascript and databasejavascript and database i want to connect
javascript pages with msaccess (as a database)how can i do so
javascript queryjavascript query how to get
javascript variable value into java variable??
i have one value in
javascript variable(var name = value )
i want this name variable value in java variable (string name1
javascript validationjavascript validation How to do
javascript validations to check whether the entered primary key is present in the database or not .Iam using jsp language
javascript validationjavascript validation How to do
javascript validations to check whether the entered primary key is present in the database or not .Iam using jsp language
What is JavaScript?What is
JavaScript? Hi,
Sometime the students trying to know make... is Java script and other java related queries. How to define what is
JavaScript... is
JavaScript" and How it will help the developer in Java Program?
Let me
Javascript and PHPJavascript and PHP Hello,
I want to know how to call
javascript...
Here is a simple example of php that calls
javascript function.
<script language="
javascript">
function hello()
{
alert("Hello World");
}
<
JavaScript - JavaScript TutorialJavaScript -
JavaScript Tutorial
JavaScript Tutorials is one of the best Quick
reference to the
JavaScript. In this
JavaScript reference you will find most of
the things about java script.
JavaScript tutorial is classified
Acrobat JavascriptAcrobat Javascript i want to know about complete tutorial of Acrobat
javascript in brief
settimeout in javascriptsettimeout in javascript How to call the settimeout() function in
JavaScript after a specified time
Javascript QuerryJavascript Querry How to export the ms access header data to excel using java script
javascript - XMLjavascript HI,
Greetings....
I want to call
javascript file i.e. ".js" from xml file. If it is possible tell me how to do that. and i want to know how to call
javascript function from xml...
Please help me in this regard
timespan in javascripttimespan in javascript How to calculate timespan in Java and
JavaScript?
stringToDate: function(string) {
var matches...;
};
}
Timespan in
Javascript JavaScript basicJavaScript basic What does "1"+2+4 evaluate to?
Since "1" is a string, everything is a string, so the result is a string of "124
Embedded JavaScript
Embedded
JavaScript
Embedded
JavaScript (EJS) is an open source
JavaScript template library.
Read full DescriptionADS_TO_REPLACE_1