L
Leszek
Hi.
I wrote a script:
function zmiana(ile){
while(document.getElementById('accomp').childNodes.length>1){
ostatni=document.getElementById('document.dane.accomp').lastChild;
document.getElementById('document.dane.accomp').removeChild(ostatni);
}
for (i=1;i<=ile;i++){
pole=document.createElement("BR");
document.getElementById('accomp').appendChild(pole);
a=document.createTextNode("Name of accompanying person #"+i+" ")
document.getElementById('accomp').appendChild(a);
dane.style.fontWeight='bold';
pole=document.createElement("input");
pole.type = "text";
pole.size="40";
pole.id="$name"+i;
pole.name="$name"+i;
document.getElementById('accomp').appendChild(pole);
}
}
it's working with a form:
<form name="accomp">
// instructions
</form>
But now i want to put my form into another form:
<form name="dane">
<form name="accomp">
// instructions
</form>
<form>
What should i change in my function to make it working with my new form?
I tried putting 'dane.accomp' instead of 'accomp' but i'm getting a message
that "object is required"
when I put 'dane' instead of 'accomp' I didin't get any errors but it
didin't work correctly.
What's wrong?
Thanks for any ideas.
Leszek
I wrote a script:
function zmiana(ile){
while(document.getElementById('accomp').childNodes.length>1){
ostatni=document.getElementById('document.dane.accomp').lastChild;
document.getElementById('document.dane.accomp').removeChild(ostatni);
}
for (i=1;i<=ile;i++){
pole=document.createElement("BR");
document.getElementById('accomp').appendChild(pole);
a=document.createTextNode("Name of accompanying person #"+i+" ")
document.getElementById('accomp').appendChild(a);
dane.style.fontWeight='bold';
pole=document.createElement("input");
pole.type = "text";
pole.size="40";
pole.id="$name"+i;
pole.name="$name"+i;
document.getElementById('accomp').appendChild(pole);
}
}
it's working with a form:
<form name="accomp">
// instructions
</form>
But now i want to put my form into another form:
<form name="dane">
<form name="accomp">
// instructions
</form>
<form>
What should i change in my function to make it working with my new form?
I tried putting 'dane.accomp' instead of 'accomp' but i'm getting a message
that "object is required"
when I put 'dane' instead of 'accomp' I didin't get any errors but it
didin't work correctly.
What's wrong?
Thanks for any ideas.
Leszek