Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando
Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando
Abbiamo giocato a lungo a Battlefield 6, abbiamo provato tutte le modalità multiplayer, Redsec, e le numerose personalizzazioni. In sintesi, ci siamo concentrati su ogni aspetto del titolo per comprendere al meglio uno degli FPS più ambiziosi della storia dei videogiochi e, dopo quasi due mesi, abbiamo tirato le somme. In questo articolo, condividiamo con voi tutto ciò che è Battlefield 6, un gioco che, a nostro avviso, rappresenta esattamente ciò che questo genere attendeva da tempo
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare
Abbiamo messo alla prova il drone Antigravity A1 capace di riprese in 8K a 360° che permette un reframe in post-produzione ad eliche ferme. Il concetto è molto valido, permette al pilota di concentrarsi sul volo e le manovre in tutta sicurezza e decidere con tutta tranquillità come gestire le riprese. La qualità dei video, tuttavia, ha bisogno di uno step in più per essere competitiva
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator
Dopo oltre 4 anni si rinnova la serie Sony Alpha 7 con la quinta generazione, che porta in dote veramente tante novità a partire dai 30fps e dal nuovo sensore partially stacked da 33Mpixel. L'abbiamo provata per un breve periodo, ecco come è andata dopo averla messa alle strette.
Tutti gli articoli Tutte le news

Vai al Forum
Discussione Chiusa
 
Strumenti
Old 25-06-2009, 15:33   #1
fullavia
Junior Member
 
Iscritto dal: Jun 2009
Messaggi: 1
Problemi con document.createelment

salve,

ho un problema che non riesco a risolvere, probabilmente per la mia scarsa conoscenza di javascript.

Spiego di che si tratta:

La funzione javascript sottostante richiamata da un tasto, replica tutta la serie di elementi (select, input, checkbox) presenti nel form
Nella funzione la select è generata così:

function addRowToTable()
{
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);

// chk1 cell
var cellChk1 = row.insertCell(0);
var el = document.createElement("input");
el.type = 'checkbox';
el.name = 'Key' + iteration;
el.id = 'Key' + iteration;
el.className = 'div';
el.checked=false;
el.defaultChecked=false;
cellChk1.appendChild(el);

// Input1 cell
var cellInput1 = row.insertCell(1);
var el = document.createElement('input');
el.type = 'text';
el.name = 'fld' + iteration;
el.id = 'fld' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput1.appendChild(el);

// select1 cell
var cellSel1 = row.insertCell(2);
var sel = document.createElement('select');
sel.name = 'Type' + iteration;
sel.id = 'Type' + iteration;

<%
dim RSType
set RSType = Server.CreateObject("ADODB.RECORDSET")
RSType.ActiveConnection=Objconn
RSType.Open("select * from sys.systypes order by name")

Response.Write("sel.options[0] = new Option('scegli un data type', '');")
i=1
while not RSType.EOF
Response.Write "sel.options[" & i & "] = new Option('" & trim(RSType(0)) & "', '" & trim(RSType(0)) & "');"
RSType.movenext
i=i+1
wend
RSType.close
set RSType=nothing
%>
sel.onchange = CliK(sel.id);
sel.className = 'div';
cellSel1.appendChild(sel);


// Input2 cell
var cellInput2 = row.insertCell(3);
var el = document.createElement('input');
el.type = 'text';
el.name = 'lnt' + iteration;
el.id = 'lnt' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput2.appendChild(el);

// Input3 cell
var cellInput3 = row.insertCell(4);
var el = document.createElement('input');
el.type = 'text';
el.name = 'prc' + iteration;
el.id = 'prc' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput3.appendChild(el);

// Input4 cell
var cellInput4 = row.insertCell(5);
var el = document.createElement('input');
el.type = 'text';
el.name = 'scl' + iteration;
el.id = 'scl' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput4.appendChild(el);

// Input5 cell
var cellInput5 = row.insertCell(6);
var el = document.createElement('input');
el.type = 'text';
el.name = 'dft' + iteration;
el.id = 'dft' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput5.appendChild(el);

// chk2 cell
var cellChk2 = row.insertCell(7);
var el = document.createElement("input");
el.type = 'checkbox';
el.name = 'nll' + iteration;
el.id = 'nll' + iteration;
el.className = 'div';
el.checked=false;
el.defaultChecked=false;
cellChk2.appendChild(el);

// chk1 cell
var cellChk3 = row.insertCell(8);
var el = document.createElement("input");
el.type = 'checkbox';
el.name = 'idt' + iteration;
el.id = 'idt' + iteration;
el.className = 'div';
el.checked=false;
el.defaultChecked=false;
cellChk3.appendChild(el);

// Input6 cell
var cellInput6 = row.insertCell(9);
var el = document.createElement('input');
el.type = 'text';
el.name = 'off' + iteration;
el.id = 'off' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput6.appendChild(el);

// Input7 cell
var cellInput7 = row.insertCell(10);
var el = document.createElement('input');
el.type = 'text';
el.name = 'inc' + iteration;
el.id = 'inc' + iteration;
el.className = 'div';
el.size = 8;
el.onkeypress = keyPressTest;
cellInput7.appendChild(el);

}
La funzione richiamata da sel.onchange è la seguente:

function CliK(idx)
{
if ((document.getElementById('Key' + idx).checked) && (document.getElementById('type' + idx).value) == "int")
{
document.getElementById('idt' + idx).checked=true;
document.getElementById('nll' + idx).checked=false;
document.getElementById('off' + idx).value=1;
document.getElementById('inc' + idx).value=1;
document.getElementById('idt' + idx).disabled=true;
document.getElementById('lnt' + idx).disabled=true;
document.getElementById('nll' + idx).disabled=true;
}
else
{
document.getElementById('idt' + idx).checked=false;
document.getElementById('nll' + idx).checked=true;

}
}


Il problema è che quest'ultima funzione va in errore e mi dice "Necessario oggetto" come se l'Id della select non fosse "type"
o l'id della checkbox non fosse "key"

Dov'è che sbaglio?
fullavia è offline  
Old 26-06-2009, 10:29   #2
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
cionci è offline  
 Discussione Chiusa


Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando Due mesi di Battlefield 6: dalla campagna al bat...
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare Antigravity A1: drone futuristico per riprese a ...
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator Sony Alpha 7 V, anteprima e novità della ...
realme GT 8 Pro Dream Edition: prestazioni da flagship e anima racing da F1 realme GT 8 Pro Dream Edition: prestazioni da fl...
OVHcloud Summit 2025: le novità del cloud europeo tra sovranità, IA e quantum OVHcloud Summit 2025: le novità del cloud...
SpaceX: capitalizzazione di 800 miliardi...
'L'UE dovrebbe essere abolita': la spara...
Non solo smartphone: Samsung sta lavoran...
Nessuno vuole comprare iPhone Air: il va...
Porsche Taycan 2027 elettrica con cambio...
Roscosmos: stazione spaziale russa ROS a...
Auto 2035, sei governi UE (c'è l'...
Chernobyl: la cupola di contenimento non...
SSD come CPU: queste memorie sono in gra...
La previsione di CATL: barche elettriche...
Stangata in arrivo: PC e notebook coster...
Lian Li si è inventata il primo a...
Amazon in raptus sconti: ogni 24 ore nov...
44 idee regalo sotto i 50€: con le offer...
Super Sconti Amazon Haul: ribassi fino a...
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: 06:39.


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