dinamica con che linguaggio ???
dinamica con che linguaggio ???
odio chi parla di politica..
anzi vorrei fondare un partito contro tutto ciò
asp
praticamente ciclo dei record di un db e in base a qaunti ne trovo creo i checkbox.
mi servirebbe una funz tipo che mi dia null se il checkbox non esiste....
function checkEnable(){
i = 100;
for(j=1;j<i;j++){
if( ! isNull(..il checkbox) && document.getElementById('check' + j).checked){
document.getElementById(j).disabled = false;
document.getElementById(j).value = '';
}else{
document.getElementById(j).disabled = true;
document.getElementById(j).value = 'Non ferma';
}
}
}
bene meno male che è asp....
posta il ciclo asp dove scrivi textbox e checkbox che ti scrivo il javascript "dinamico"
odio chi parla di politica..
anzi vorrei fondare un partito contro tutto ciò
<script language="javascript">
function checkEnable(){
i = 100;
for(j=1;j<i;j++){
if(document.getElementById('check' + j).checked){
document.getElementById(j).disabled = false;
document.getElementById(j).value = '';
}else{
document.getElementById(j).disabled = true;
document.getElementById(j).value = 'Non ferma';
}
}
}
</script>
</head>
<body onLoad="javascript:checkEnable();">
....
<%
indice = 1
while Not rstFermate.EOF
%><tr><td width="25%">
<%=rstFermate("fermata")%></td>
<td><input name="<%=indice%>" tabIndex="<%=indice%>" title="orario" value="" size="8" maxlength="5" onBlur="javascript:validaOra('<%=indice%>');">
Fermata attiva<input type="checkbox" id="check<%=indice%>" name="check<%=indice%>" title="attiva" checked onClick="javascript:disattivaTime('<%=indice%>');" >
</td>
</tr><%
indice = indice + 1
rstFermate.movenext
wend
rstFermate.close
......
...
ecco qua tutto adattato![]()
codice:<script language="javascript"> function checkEnable(j){ if(document.getElementById('check' + j).checked){ document.getElementById(j).disabled = false; document.getElementById(j).value = ''; }else{ document.getElementById(j).disabled = true; document.getElementById(j).value = 'Non ferma'; } } </script> </head> <body> .... <% indice = 1 while Not rstFermate.EOF %><tr><td width="25%"> <%=rstFermate("fermata")%></td> <td><input name="<%=indice%>" tabIndex="<%=indice%>" title="orario" value="" size="8" maxlength="5" onBlur="javascript:validaOra('<%=indice%>');"> Fermata attiva <input type="checkbox" id="check<%=indice%>" name="check<%=indice%>" title="attiva" checked onClick="javascript:disattivaTime('<%=indice%>');"> <script language="javascript"> checkEnable('<%=indice%>') </script> </td> </tr><% indice = indice + 1 rstFermate.movenext wend rstFermate.close
odio chi parla di politica..
anzi vorrei fondare un partito contro tutto ciò
...non credo funzioni, avevo già provato...
solo che l'avevo messo fuori dal ciclo assegnando quanti check erano stati messi all'indice del ciclo...
ok ma che errore ti da ???
odio chi parla di politica..
anzi vorrei fondare un partito contro tutto ciò
e questo soprattutto ho visto ora... dov'è ???
document.getElementById(j)
odio chi parla di politica..
anzi vorrei fondare un partito contro tutto ciò
così va!!finalmente!!!
<body onLoad="javascript:checkEnable();">
e poi alla fine della pagina ho messo:
<script language="javascript">
function checkEnable(j){
var i = <%=indice%>;
for(j=1;j<i;j++){
if(document.getElementById('check' + j).checked){
document.getElementById(j).disabled = false;
document.getElementById(j).value = '';
}else{
document.getElementById(j).disabled = true;
document.getElementById(j).value = 'Non ferma';
}
}
}
</script>