Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione Borderlands 4, tra divertimento e problemi tecnici
Recensione Borderlands 4, tra divertimento e problemi tecnici
Gearbox Software rilancia la saga con Borderlands 4, ora disponibile su PS5, Xbox Series X|S e PC. Tra le novità spiccano nuove abilità di movimento, un pianeta inedito da esplorare e una campagna che lascia al giocatore piena libertà di approccio
TCL NXTPAPER 60 Ultra: lo smartphone che trasforma la lettura da digitale a naturale
TCL NXTPAPER 60 Ultra: lo smartphone che trasforma la lettura da digitale a naturale
NXTPAPER 60 Ultra è il primo smartphone con tecnologia NXTPAPER 4.0 per il display, un ampio IPS da 7,2 pollici. Con finitura anti-riflesso, processore MediaTek Dimensity 7400, fotocamera periscopica e modalità Max Ink per il detox digitale, NXTPAPER 60 Ultra punta a essere il riferimento tra gli smartphone pensati per il benessere degli occhi.
Un fulmine sulla scrivania, Corsair Sabre v2 Pro ridefinisce la velocità nel gaming
Un fulmine sulla scrivania, Corsair Sabre v2 Pro ridefinisce la velocità nel gaming
Questo mouse ultraleggero, con soli 36 grammi di peso, è stato concepito per offrire un'esperienza di gioco di alto livello ai professionisti degli FPS, grazie al polling rate a 8.000 Hz e a un sensore ottico da 33.000 DPI. La recensione esplora ogni dettaglio di questo dispositivo di gioco, dalla sua agilità estrema alle specifiche tecniche che lo pongono un passo avanti
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 08-01-2008, 09:57   #1
DarkSun84
Member
 
L'Avatar di DarkSun84
 
Iscritto dal: Oct 2005
Città: Roma
Messaggi: 175
Javascript

Salve, volevo sapere come si potevano mettere dei form html all'interno di celle di una tabella che mi creo con javascript. grazie.
__________________
AN7, Athlon xp2400 @2400MHz, OCZ pc 3700 gold, 6600GT @600MHz, raid0 with seagate, Pioneer DVD-RW DVR-115D, PCTV, Thermaltake Purepower 420W, OCLABS liquid, Gentoo powered. MyCase, Bubble-TraProjex visita il mio sito:
www.ecoglobo.it
DarkSun84 è offline   Rispondi citando il messaggio o parte di esso
Old 09-01-2008, 10:08   #2
valse
Senior Member
 
L'Avatar di valse
 
Iscritto dal: Sep 2001
Città: Lecco
Messaggi: 404
Quote:
Originariamente inviato da DarkSun84 Guarda i messaggi
Salve, volevo sapere come si potevano mettere dei form html all'interno di celle di una tabella che mi creo con javascript. grazie.
Cerca di essere più chiaro... magari con lo scopo che devi raggiungere...
__________________
Dell XPS 17 Sandy Bridge (L702x) • Kingston 128GB SSDNow V100 • Zalman ZM-NC3000U Cooler • tastiera retroilluminata
valse è offline   Rispondi citando il messaggio o parte di esso
Old 10-01-2008, 11:51   #3
DarkSun84
Member
 
L'Avatar di DarkSun84
 
Iscritto dal: Oct 2005
Città: Roma
Messaggi: 175
tramite questo bottone:
Codice:
<button onClick="addTestHttp()">http</button>
voglio aggiungere dinamicamente in una tabella html delle righe in cui in ogni cella avrà dei dati da inserire tramite dei form, ho trovato il seguente modo:
Codice:
var numRow=-1;
mycurrent_row=new Array();

function addTestHttp(){
numRow++;
 mycurrent_row[numRow] = document.createElement("tr");
for(var i = 0; i < 6; i++) {

if(i==0){
mycurrent_cell0= document.createElement("td");
mycurrent_cell0.innerHTML=numRow;
/ /appends the cell<td> into the row<tr>           mycurrent_row[numRow].appendChild(mycurrent_cell0);
				}



if(i==1){
mycurrent_cell1= document.createElement("td");
mycurrent_cell1.innerHTML="<SELECT name=list onchange=AddRow1(mycurrent_cell1,numRow)><option>www.esa.it</option><option>www.google.com</option><optionwww.nasa.gov</option><option>manual</option></SELECT>";
 // appends the cell <td> into the row <tr>
                mycurrent_row[numRow].appendChild(mycurrent_cell1);
				}
  }
}


function AddRow1(cell,num)
{
cell.innerHTML="<input type=text name=textField>";
alert(num);
}
Ho il seguente problema che non riesco a prendere i dati inseriti nel form della cella, tramite il php con la variabile $_POST[...] se qualcuno mi può aiutare.
__________________
AN7, Athlon xp2400 @2400MHz, OCZ pc 3700 gold, 6600GT @600MHz, raid0 with seagate, Pioneer DVD-RW DVR-115D, PCTV, Thermaltake Purepower 420W, OCLABS liquid, Gentoo powered. MyCase, Bubble-TraProjex visita il mio sito:
www.ecoglobo.it

Ultima modifica di DarkSun84 : 10-01-2008 alle 11:53.
DarkSun84 è offline   Rispondi citando il messaggio o parte di esso
Old 10-01-2008, 13:08   #4
valse
Senior Member
 
L'Avatar di valse
 
Iscritto dal: Sep 2001
Città: Lecco
Messaggi: 404
...mi manca un punto... io ho una tabella... aggiungo una riga o colonna con dentro un campo di testo via javascript e questo è ok... poi voglio mandare tramite submit della pagina il contenuto di tutte le righe/colone create giusto?

Io farei un unico form e quando creo dinamicamente la input textbox devo anche assegnargli un id (es. text_01, text_02) che richiamo in post nella pagina seguente...

...se così nn funzia vai di query string ;-)
__________________
Dell XPS 17 Sandy Bridge (L702x) • Kingston 128GB SSDNow V100 • Zalman ZM-NC3000U Cooler • tastiera retroilluminata
valse è offline   Rispondi citando il messaggio o parte di esso
Old 10-01-2008, 17:31   #5
DarkSun84
Member
 
L'Avatar di DarkSun84
 
Iscritto dal: Oct 2005
Città: Roma
Messaggi: 175
posto le modifiche fatte:
Codice:
var numberRow=0;
tr= new Array();


function addHtmlTest() {      //////   HTTP TEST   //////

  numberRow++;
  tr[numberRow]=document.createElement('tr');  	// - now create the tr and td elements
  var td0=document.createElement('td');
  var td1=document.createElement('td');
  var td2=document.createElement('td');
  var td3=document.createElement('td');
  var td4=document.createElement('td');
  var td5=document.createElement('td');

  td0.style.textAlign='center'; 	td0.style.padding='3px';
  td1.style.textAlign='center';   	td1.style.padding='3px';
  td2.style.textAlign='center';     td2.style.padding='3px';
  td3.style.textAlign='center';		td3.style.padding='3px';
  td4.style.textAlign='center';		td4.style.padding='3px';
  td5.style.textAlign='center';		td5.style.padding='3px';



var tdText0=document.createTextNode('HTTP-test'+numberRow);  //  create the text that will go in the table cell

var address = document.createElement('select');     

//select form address http

address.setAttribute("id","addressHttp");
//address.setAttribute("name","addressHttp");

//first option

//create an option

theOption=document.createElement("OPTION");

//make text

theText=document.createTextNode("www.esa.it");

//add the text to the option

theOption.setAttribute("value","http://www.esa.int/esaCP/Italy.html");

theOption.appendChild(theText);

//add the option to the select

address.appendChild(theOption);

//second option

theOption=document.createElement("OPTION");

theText=document.createTextNode("www.nasa.gov");

theOption.appendChild(theText);

theOption.setAttribute("value","www.nasa.gov");

address.appendChild(theOption);

//third option

theOption=document.createElement("OPTION");

theText=document.createTextNode("others");

theOption.appendChild(theText);

theOption.setAttribute("value","others");

address.appendChild(theOption);


  var start= document.createElement('input');
  start.setAttribute('type','text');
  start.setAttribute('id','START');
  start.setAttribute('name','start');
  start.setAttribute('value','0');


  var end= document.createElement('input');
  end.setAttribute('type','text');
  end.setAttribute('name','end');
  end.setAttribute('value','5');




// source

td4.innerHTML="<select name=st><?php for($i=0;$i<$_SESSION['st'];$i++){for( $e=0;$e<$_SESSION["numberUser[$i]"];$e++ ){$t=$i+1;$u=$e+1;echo '<option>'."ST$t".'-'."UT$u".'</option>';}}?></select>";


// destionation


td5.innerHTML="<select name=st><?php for($i=0;$i<$_SESSION['st'];$i++){for( $e=0;$e<$_SESSION["numberUser[$i]"];$e++ ){$t=$i+1;$u=$e+1;echo '<option>'."ST$t".'-'."UT$u".'</option>';}}?></select>";



  // - Now start building the table.  It's like filling a big container with successively smaller ones, just in reverse

  td0.appendChild(tdText0);  					// - put the text node in the table cell
  td1.appendChild(address);
  td2.appendChild(start);
  td3.appendChild(end);
 
  tr[numberRow].appendChild(td0); 						// - put the cell into the row
  tr[numberRow].appendChild(td1);
  tr[numberRow].appendChild(td2);
  tr[numberRow].appendChild(td3);
  tr[numberRow].appendChild(td4);
  tr[numberRow].appendChild(td5);


 tb.appendChild(tr[numberRow]); 					// - put the row into the tbody
t.appendChild(tb);						// - put the tbody into the table
ourDiv.appendChild(t); 					// - put the table into the div
}
creazione dell'unico form come mi hai suggerito
Codice:
 create the form element and it's attributes
  var f=document.createElement('form');
 // f.setAttribute('name','myForm');
  f.setAttribute('action','configTest.php');
  //f.setAttribute('target','_blank');
  f.setAttribute('method','post');
  f.setAttribute("id","formTable");
creazione tabella iniziale:
Codice:
  var ourDiv=document.getElementById('tableTest');
  var t=document.createElement('table');	// - start by creating the table element
  f.appendChild(t);
  var tb=document.createElement('tbody');  	// - create a tbody element

   // sets the border attribute of mytable to 2;
        t.setAttribute("border","2");
        t.setAttribute("width","100%");
		t.setAttribute("cellspacing","2");
		t.setAttribute("cellpadding","2");

  var tr=document.createElement('tr');  	// - now create the tr and td elements
  var td0=document.createElement('td');
  var td1=document.createElement('td');
  var td2=document.createElement('td');
  var td3=document.createElement('td');
  var td4=document.createElement('td');
  var td5=document.createElement('td');

  td0.style.textAlign='center'; 	td0.style.padding='3px';
  td1.style.textAlign='center';   	td1.style.padding='3px';
  td2.style.textAlign='center';     td2.style.padding='3px';
  td3.style.textAlign='center';		td3.style.padding='3px';
  td4.style.textAlign='center';		td4.style.padding='3px';
  td5.style.textAlign='center';		td5.style.padding='3px';

  var tdText0=document.createTextNode('Name-Test');  // - create the text that will go in the table cell
  var tdText1=document.createTextNode('Details of test');
  var tdText2=document.createTextNode('Start');
  var tdText3=document.createTextNode('End');
  var tdText4=document.createTextNode('Source');
  var tdText5=document.createTextNode('Destination');


  // - Now start building the table.  It's like filling a big container with successively smaller ones, just in reverse

  td0.appendChild(tdText0);  					// - put the text node in the table cell
  td1.appendChild(tdText1);
  td2.appendChild(tdText2);
  td3.appendChild(tdText3);
  td4.appendChild(tdText4);
  td5.appendChild(tdText5);


  tr.appendChild(td0); 						// - put the cell into the row
  tr.appendChild(td1);
  tr.appendChild(td2);
  tr.appendChild(td3);
  tr.appendChild(td4);
  tr.appendChild(td5);


  tb.appendChild(tr); 						// - put the row into the tbody
  t.appendChild(tb);						// - put the tbody into the table
  ourDiv.appendChild(t);



var b= document.createElement('input');
  b.setAttribute('type','submit');
  //b.setAttribute('name','start');
  b.setAttribute('value','Save');
  f.appendChild(b);
  document.getElementById('formTest').appendChild(f);
parte del body:
Codice:
<button onClick="addHtmlTest()">http</button>
Ho il problema che non riesco a far passare i valori che inserisco nel form tramite post nella variabili $_POST[...].
__________________
AN7, Athlon xp2400 @2400MHz, OCZ pc 3700 gold, 6600GT @600MHz, raid0 with seagate, Pioneer DVD-RW DVR-115D, PCTV, Thermaltake Purepower 420W, OCLABS liquid, Gentoo powered. MyCase, Bubble-TraProjex visita il mio sito:
www.ecoglobo.it
DarkSun84 è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Recensione Borderlands 4, tra divertimento e problemi tecnici Recensione Borderlands 4, tra divertimento e pro...
TCL NXTPAPER 60 Ultra: lo smartphone che trasforma la lettura da digitale a naturale TCL NXTPAPER 60 Ultra: lo smartphone che trasfor...
Un fulmine sulla scrivania, Corsair Sabre v2 Pro ridefinisce la velocità nel gaming Un fulmine sulla scrivania, Corsair Sabre v2 Pro...
Nokia Innovation Day 2025: l’Europa ha bisogno di campioni nelle telecomunicazioni Nokia Innovation Day 2025: l’Europa ha bisogno d...
Sottile, leggero e dall'autonomia WOW: OPPO Reno14 F conquista con stile e sostanza Sottile, leggero e dall'autonomia WOW: OPPO Reno...
Microsoft aggiunge i modelli Claude di A...
iPhone 16e all'incredibile prezzo di 499...
OpenAI - NVIDIA, tra investimenti e GPU ...
Un androide dal volto umano e in grado d...
Amazfit Balance 2 XT arriva in Italia: p...
Realme spoilera il nuovo GT 8 Pro: svela...
La Cina sorprende tutti: annunciato il p...
Samsung Galaxy S26 Ultra: la ricarica sa...
Disagi al traffico aereo europeo: le ind...
Intel in crisi chiama Apple: un riavvici...
Snapdragon X2 Elite Extreme, il cuore de...
Snapdragon 8 Elite Gen 5 è il nuovo rife...
Bombe Apple su Amazon: iPhone di scorsa ...
Micron: memoria HBM4 a 11 Gbps e patto d...
NVIDIA rende Audio2Face open source: ecc...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 08:01.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Served by www3v