javascipt

javascipt

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=11;
product_id.name="product_id";

var pro_desc = document.createElement('input');
pro_desc.type="text";
pro_desc.id="pro_desc";
pro_desc.size=22;
pro_desc.name="pro_desc";
var stocks= document.createElement('input');
stocks.type="text";
stocks.id="stocks";
stocks.size=17;
stocks.name="stocks";
var newDelButton = document.createElement('input');
newDelButton.type ="button";
newDelButton.value = "Delete";

var newsaveButton = document.createElement('input');
newsaveButton.type ="button";
newsaveButton.value = "save";
newDiv.appendChild(product_id);
newDiv.appendChild(pro_desc);
newDiv.appendChild(stocks);



newDiv.appendChild(newDelButton);
newDiv.appendChild(newsaveButton);
mainContainer.appendChild(newDiv);



newDelButton.onclick = function() {
mainContainer.removeChild(newDiv);

}

newsaveButton.onclick=function(){

View Answers

January 13, 2010 at 4:12 PM

Hi Friend,

I want that code through which you are inserting data into database.

Thanks









Related Tutorials/Questions & Answers:
javascipt - Java Beginners
javascipt - Design concepts & design patterns
Advertisements
php variable in javascript
php variable in javascript  Access php variables in Javascipt or Jquery rather than php echo $variable
Ajax Web Framework, Frameworks for Ajax
. These are directly included into HTML code and used with the help of JavaScipt code. Here

Ads