JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old August 23rd, 2004, 04:18 PM
Horizon Horizon is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Horizon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
function addRowToTable -Post new ROW to DB

I have a table where I have used the code to have a new row added when selecting a button. It has this code behind it:

function addRowToTable()
{
var tbl = document.getElementById('Detail');
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);


var cell1 = row.insertCell(0);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'txtRow' + iteration);
el.setAttribute('size', '10');
cell1.appendChild(el);


I'm adding a row that has 4 cells. The first row is defined with values that are pushed to a SQL Database, and the update works fine. However, any of the "new" rows created by using the function do NOT update to the DB.

I need help on how to label the new rows (fields) correctly- and to get those recognized by my SQL statement.

sConnString = "Provider=SQLOLEDB; Data Source=; Initial Catalog=; User ID=; Password=; Network Library=dbmssocn;"

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open(sConnString)

sSQL = "INSERT INTO AftHrs (ddate, ihours, vname, vemail, ibackup, iincident) VALUES ('" & ddate & "','" & ihours & "','" & vname & "','" & vemail & "','" & ibackup & "','" & iincident & "')"

sSQL1 = "INSERT INTO AftHrsDet (vcaller, vcomments, ddatedet, iincidentdet, ihourswork) VALUES ('" & ReplaceQuotes(vcaller) & "','" & ReplaceQuotes(vcomments) & "','" & ddatedet & "','" & iincidentdet & "','" & ihourswork & "')"

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > function addRowToTable -Post new ROW to DB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway