Click here to Skip to main content
15,881,864 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: JavaScript class problem Pin
Wjousts25-Aug-11 8:18
Wjousts25-Aug-11 8:18 
AnswerRe: JavaScript class problem Pin
AspDotNetDev25-Aug-11 7:19
protectorAspDotNetDev25-Aug-11 7:19 
GeneralRe: JavaScript class problem Pin
Wjousts25-Aug-11 7:43
Wjousts25-Aug-11 7:43 
AnswerRe: JavaScript class problem Pin
AspDotNetDev25-Aug-11 7:47
protectorAspDotNetDev25-Aug-11 7:47 
GeneralRe: JavaScript class problem Pin
Wjousts25-Aug-11 7:58
Wjousts25-Aug-11 7:58 
Questionjquery dialog autosize [modified] Pin
fififlowertot24-Aug-11 3:05
fififlowertot24-Aug-11 3:05 
AnswerRe: jquery dialog autosize Pin
Gerben Jongerius24-Aug-11 19:50
Gerben Jongerius24-Aug-11 19:50 
QuestionPassing on Javascript array data to a PHP-array Pin
Gert Koetsier18-Aug-11 6:19
Gert Koetsier18-Aug-11 6:19 
I found and adapted an HTML script as shown below. It fits my needs perfectly. However, I don't know how to store the field-values of repeated lines in a javascript array that subsequently passes its contents on to a PHP-array that enables me to store the date in a MYSQL-database. I tried to fix something myself in de 3rd codeblock of de AddRow()function.

A second problem is: when de line is repeated I need to reset de field values to default. Does anybody have the knowledge that I so obviously do not have?
======================================================================





<title>


function AddRow ()
{
var o_id = document.getElementById ("id").cloneNode(true);
var label_id = document.getElementById ("label_id").cloneNode(true);
var o_item = document.getElementById ("item").cloneNode(true);
var o_subitem = document.getElementById ("subitem").cloneNode(true);
var label_opm = document.getElementById ("label_opm").cloneNode(true);
var o_opm = document.getElementById ('opm').cloneNode(true);

// reset field opm
document.getElementById("opm").innerHTML="";

o_id.name='id[]';
o_item.name = 'item[]';
o_subitem.name = 'subitem[]';
o_opm.name = 'opm[]';

var o_button = document.createElement ("input");
o_button.type = "button";
o_button.value = "Remove";
o_button.onclick = RemoveRow;

var o_td_id = document.createElement ("td");
var o_td_item = document.createElement ("td");
var o_td_subitem = document.createElement ("td");
var o_td_opm = document.createElement ("td");
var o_td_button = document.createElement ("td");

var o_tr = document.createElement ("tr");
var o_body = document.getElementById ("dynamic_table_body");


o_td_id.appendChild (label_id);
o_td_id.appendChild (o_id);
o_td_item.appendChild (o_item);
o_td_subitem.appendChild (o_subitem);
o_td_opm.appendChild (label_opm);
o_td_opm.appendChild (o_opm);
o_td_button.appendChild (o_button);

o_tr.appendChild (o_td_id);
o_tr.appendChild (o_td_item);
o_tr.appendChild (o_td_subitem);
o_tr.appendChild (o_td_opm);
o_tr.appendChild (o_td_button);

//document.ovd.id.value++;
alert(o_item.value);

o_body.appendChild (o_tr);
}

function RemoveRow ()
{
var dinosaur = this.parentNode.parentNode;
dinosaur.parentNode.removeChild (dinosaur); // Smile | :)
}






OvD-Id

-- Choose Category --
Cat 1
Cat 2
Cat 3


-- Choose Sub Category --
Sub Cat 1
Sub Cat 2
Sub Cat 3

Remarks
Add OvD Item








AnswerRe: Passing on Javascript array data to a PHP-array Pin
Evan Gallup3-Sep-11 18:49
Evan Gallup3-Sep-11 18:49 
QuestionJavascript data (array) pass on to PHP Pin
Gert Koetsier18-Aug-11 6:15
Gert Koetsier18-Aug-11 6:15 
Questiondynamic progress bar with respect to time Pin
amjadali25516-Aug-11 18:27
amjadali25516-Aug-11 18:27 
AnswerRe: dynamic progress bar with respect to time Pin
Richard MacCutchan16-Aug-11 22:39
mveRichard MacCutchan16-Aug-11 22:39 
QuestionValidation groups with jQuery validation plugin on ASP.NET webforms? Pin
zeego14-Aug-11 19:32
zeego14-Aug-11 19:32 
AnswerCROSS POST Pin
Not Active14-Aug-11 19:40
mentorNot Active14-Aug-11 19:40 
GeneralRe: CROSS POST Pin
zeego14-Aug-11 20:06
zeego14-Aug-11 20:06 
QuestionHow to Know The Selected Date is Previous in javascript Pin
Arunkumar.Koloth13-Aug-11 20:28
Arunkumar.Koloth13-Aug-11 20:28 
AnswerRe: How to Know The Selected Date is Previous in javascript Pin
DaveAuld13-Aug-11 22:21
professionalDaveAuld13-Aug-11 22:21 
AnswerRe: How to Know The Selected Date is Previous in javascript Pin
Niral Soni24-Aug-11 2:19
Niral Soni24-Aug-11 2:19 
Questioncodeprojectforums.com [modified] Pin
sivakumat11-Aug-11 1:27
sivakumat11-Aug-11 1:27 
Questionjquery (unknown) Pin
AndyInUK11-Aug-11 0:05
AndyInUK11-Aug-11 0:05 
AnswerRe: jquery (unknown) Pin
Pete O'Hanlon11-Aug-11 0:17
mvePete O'Hanlon11-Aug-11 0:17 
AnswerRe: jquery (unknown) Pin
BobJanova11-Aug-11 2:42
BobJanova11-Aug-11 2:42 
GeneralRe: jquery (unknown) Pin
AndyInUK11-Aug-11 5:43
AndyInUK11-Aug-11 5:43 
GeneralRe: jquery (unknown) PinPopular
BobJanova11-Aug-11 7:28
BobJanova11-Aug-11 7:28 
GeneralRe: jquery (unknown) Pin
AndyInUK12-Aug-11 1:53
AndyInUK12-Aug-11 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.