By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

html after javascript function - why it doesn't work?

P: n/a
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').lastChil d;
document.getElementById('accomp').removeChild(osta tni);
}
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

Dec 26 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Leszek wrote:
I' got a problem with a web site i wrote a javascript:
<select name="accperson" onChange="zmiana(this.value)">
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?

What about </select> ?

Dec 26 '05 #2

P: n/a
Yes !!!
Thanks i forgot about it

Leszek
Dec 26 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.