Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > html after javascript function - why it doesn't work?

Reply
Thread Tools

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

 
 
Leszek
Guest
Posts: n/a
 
      12-26-2005
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



 
Reply With Quote
 
 
 
 
bwucke@gmail.com
Guest
Posts: n/a
 
      12-26-2005

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> ?

 
Reply With Quote
 
 
 
 
Leszek
Guest
Posts: n/a
 
      12-26-2005
Yes !!!
Thanks i forgot about it

Leszek


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
why why why does function not work Horace Nunley ASP .Net 1 09-27-2006 09:52 PM
Evaluating a Function After X Seconds: Python Equivalent to JavaScript's SetTimeout() Function ycoci0@gmail.com Python 3 06-12-2006 07:45 AM
** Dynamically writing html/javascript from a javascript function ** Robby Bankston Javascript 7 06-17-2005 08:23 AM



Advertisments