L
Leszek
I' got a problem with a web site i wrote a javascript:
function zmiana(ile){
while(document.getElementById('accomp').childNodes.length>3){
ostatni=document.getElementById('accomp').lastChild;
document.getElementById('accomp').removeChild(ostatni);
}
for (i=1;i<=ile;i++){
pole=document.createElement("BR");
document.getElementById('accomp').appendChild(pole);
var a=document.createTextNode("Name of accompanying person #"+i+" ")
document.getElementById('accomp').appendChild(a);
accomp.style.fontWeight='bold';
pole=document.createElement("input");
pole.type = "text";
pole.size="50";
pole.id="$name"+i;
pole.name="$name"+i;
document.getElementById('accomp').appendChild(pole);
}
}
and here is a form that using this function:
<form name="accomp">
Number of accompanying persons:
<select name="accperson" onChange="zmiana(this.value)">
<?php
$accperson=0;
echo "<option value=\"$accperson\" selected >$accperson</option> \n";
for ($accperson=1;$accperson<=5;$accperson++){
echo "<option value=\"$accperson\">$accperson </option>\n";
}
?>
</form>
After this form i've got a few lines of html (just writing some things on
the screen)
Now, the problem is that nothing what is after this form is never done. And
i don't know why
Why is this happening?
Thanks for any ideas
Leszek
function zmiana(ile){
while(document.getElementById('accomp').childNodes.length>3){
ostatni=document.getElementById('accomp').lastChild;
document.getElementById('accomp').removeChild(ostatni);
}
for (i=1;i<=ile;i++){
pole=document.createElement("BR");
document.getElementById('accomp').appendChild(pole);
var a=document.createTextNode("Name of accompanying person #"+i+" ")
document.getElementById('accomp').appendChild(a);
accomp.style.fontWeight='bold';
pole=document.createElement("input");
pole.type = "text";
pole.size="50";
pole.id="$name"+i;
pole.name="$name"+i;
document.getElementById('accomp').appendChild(pole);
}
}
and here is a form that using this function:
<form name="accomp">
Number of accompanying persons:
<select name="accperson" onChange="zmiana(this.value)">
<?php
$accperson=0;
echo "<option value=\"$accperson\" selected >$accperson</option> \n";
for ($accperson=1;$accperson<=5;$accperson++){
echo "<option value=\"$accperson\">$accperson </option>\n";
}
?>
</form>
After this form i've got a few lines of html (just writing some things on
the screen)
Now, the problem is that nothing what is after this form is never done. And
i don't know why
Why is this happening?
Thanks for any ideas
Leszek