Hi, it's me again!
I have a strange problem with a form I gotta (dynamically) insert in a
site, and copied/pasted the code to a blank page, to make it easier to
try it out. I was using the $ function of script.aculo.us , which is
substituted by the equivalent document.getEle mentById in the code below
(and the problem is still the same).
The "mystery" is that this code WORKS both in FF 2 and IE 6, but IE
gives an error at the moment when the innerHTML is executed (I tried
putting an alert before it)... my only doubt is that trying to validate
it with Dreamweaver it says that the tags in the string are nested, and
shouldn't... but IT'S JUST A STRING!!!!!
Can U help me, please? I beg U! :-)
Thanks in advance!
Massi
P.S.: yes, it's very bad-looking to see the code copied this way, and
the form's string it wouldn't work at all if I tried to "linefeed" the
string... BTW I tried to "decompress " the string, and th XHTML 1.0
Strict (still Dremweaver validator). Copying/pasting it in an editing
environment it should look much better! :-)
P.P.S.: don't take care about the CSS.. it's why I tried this code, but
it doesn't matter on the problem
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Prova</title>
</head>
<body>
<script type="text/javascript">
nome_tipo="Boh" ;
nome="Massi";
n_prog="ennepro g";
data= new Date;
descrizione="st o cazzo";
</script>
<div id="formbox">
</div>
<script type="text/javascript">
document.getEle mentById("formb ox").innerHTML= '<form action=""
method="post">< fieldset><legen d>Parametri
Subscribers</legend><p>Inser ire i nuovi parametri<br/>del subscriber
selezionato:</p><div><label for="tipo">Tipo Dispositivo<inp ut
disabled="disab led" type="text" id="tipo" name="tipo"
value="Subscrib er"/></label></div><div><label
for="ID">Identi ficativo<input type="text" id="ID" name="ID"
value="'+nome+' "/></label></div><div><label for="number">N& deg;
Progressivo<inp ut type="text" id="number" name="number"
value="'+n_prog +'"/></label></div><div><label
for="descrizion e">Descrizione< textarea name="descrizio ne"
id="descrizione " rows="3"
cols="15">'+des crizione+'</textarea></label></div></fieldset><field set><legend>Dat a
odierna</legend><label for="day" class="labelcor ta">GG<input
disabled="disab led" name="day" type="text" id="day" size="2"
maxlength="2" value="'+data.g etDate()+'"/></label><label for="month"
class="labelcor ta">MM<input disabled="disab led" name="month" type="text"
id="month" size="2" maxlength="2"
value="'+(data. getMonth()+1)+' "/></label><label for="year"
class="labelcor ta">AAAA<inpu t disabled="disab led" name="year"
type="text" id="year" size="4" maxlength="4"
value="'+data.g etFullYear()+'"/></label></fieldset><field set><legend>Ora
attuale:</legend><label for="ore" class="labelcor ta">ora<input
disabled="disab led" name="ore" type="text" id="ore" size="2"
maxlength="2" value="'+data.g etHours()+'"/></label><label for="minuti"
class="labelcor ta">min.<inpu t disabled="disab led" name="minuti"
type="text" id="minuti" size="2" maxlength="2"
value="'+data.g etMinutes()+'"/></label><label for="secondi"
class="labelcor ta">sec.<inpu t disabled="disab led" name="secondi"
type="text" id="secondi" size="2" maxlength="2"
value="'+data.g etSeconds()+'"/></label></fieldset><div
id="bottoni"><i nput type="button" value="Annulla"
onclick="toglif orm()"/><input type="submit" class="big"
onclick="wait() ;raccogliDatiUt ente(\"formbox\ ");addeseguito( \"Sono state
modificate le caratteristiche del subscriber selezionato\")"
value="Modifica Dati"/></div></form>';
</script>
</body>
</html>