getElementById(["groupitems"])
is wrong.
it must be
getElementById("groupitems");

And you're AJAX is very badly programmed. And this is not the correct forum to post your problem at. This is JavaScript NOT php.
And this is a PHP forum.

Refer to AJAX Tutorials:
POST AJAX
GET AJAX
And possibly use that forum there instead when you have problems. They will be answered if you ask. Or leave a comment on a tutorial. But this is not an AJAX or JS forum.

    After all these year I finally earned my pbuilder multi-slap, WOW!

    yeah, guess I had this one coming... sorry...
    sure wished I could get my old handle back...

    been on this board since it began, thought maybe someone could appreciated the combo...
    although I took out the php code to simplify things... thought maybe some of you js geeks would want to comment on this and help a php geek out...

    sitepoint.com execute said your code stinks... does that make it better? <grin>

    I've never liked any of their tutorials at sitepoint.com (for PHP) but this AJAX one was very interesting and it did work well, without the use of an AJAX Library... Afterward some AJAX geeks were pretty impressed with how well this worked without a library. So not sure where you're going with the comment, but I'll take your word for it... bad programming sitepoint bad....

    anyway it works well now, sorry I clutterd the board with js...
    but if you are interested in trying something new (alternative to iframes) to make your php code dynamic the above piece of code does work well... later...

    One thing you can count on at phpbuilder.com is to getted slapped if it's not 100% php...
    WHOA!

      Hi i faced the same problem but somehow i solved it using iframes. i am sending you the function i have used to populate the options list. i hope it might be of some help to you.

      function getprice(thisqty)
      {
      var iframe = document.getElementById("ProductFrame");
      var iframeDoc = iframe.Document;

      var getqty = iframeDoc.getElementById("qty");
      var getdeal = iframeDoc.getElementById("deaname");
      var getsize = iframeDoc.getElementById("getsize");

      				var elOptNew = document.createElement('option');
      				elOptNew.text = iframeDoc.getElementById("deaname").value;
      				elOptNew.value = iframeDoc.getElementById("deaname").value;
      				var elSel = document.getElementById('dealname');
      				var getvalue=elOptNew.value;
      
      		//document.getElementById(thisqty).value = getqty.value;
      		var size=iframeDoc.getElementById("deaname");
      
      		if(document.orderform.dealname.length > 1)
      		{
      		}
      		else
      		{
      			for(i=0; i<=getsize.value-1; i++)
      			{
      				var getvalue = getvalue.replace(/%2C/g,",",getvalue);
      				var getvalue = getvalue.replace(/\+/g," ",getvalue); 
      				var getvalue = getvalue.replace(/%27/g,"'",getvalue);
      				var remcoma = new Array();
      				remcoma = getvalue.split(",");
      				elOptNew.text=remcoma[i];
      				elOptNew.value=remcoma[i];
      				elSel.add(elOptNew);
      				var elOptNew = document.createElement('option');
      			}
      		}
      }

      what i am doing is getting the multiple values from iframe and then later on split it create a new option element it and populate it with the values. Go through it i dont know it might be of help to some you.

      and to all the smart php geeks out there who says this is the only php forum. You guys when we use javascript with php why cant we post it here which anyway integrates with php. why most of them uses javascript with php. So help out the person who is using php with javascript.

        thanks for the backup zubinkasad....

        there's always a few cops on the board, as there should be, but being that this is used in combo with php it should be ok...

        I do something similar with iframes, just trying out something new with this AJAX stuff...

        There's been a lot of media hipe on AJAX lately, had a project that came along that needed the dynamic updates, so gave it a shot...

        It's actually very nice, and would encourage everyone to check into this...
        There are some AJAX libraries out there specifically for php geeks...

        no worries, Merry Christmas and thanks for the input.....

          man... i simply asked you what your problem was. you never did state it.

            HAhahahah Gimme a link if its a forum post. But hahahahah, half the people there dont know *** about Javascript let alone AJAX.

            So the people at sitepoint think my code is bad? Oh really? Well I sure would like to know what exactly they didn't like about it.

              I made this statement on your behalf...

              "sitepoint.com execute said your code stinks... does that make it better?"

              if you don't like the code posted here earlier, blame sitepoint.com
              that's where I found the code via a google search... and it does work well after a few tweaks...

              Used it again today, guess that makes me a bad programmer... <grin>

              I agree with you, sitepoint.com is not the best choice to learn anything...
              However this one piece is pretty slick... later dude...

                oh ok thanks. I read articles about AJAX all day so my script is the one that was made with all features in mind.

                  Even i am looking for some AJAX libraries if you can provide me some link or insight of it, would be very helpfull.

                  thanks

                    I don't use libraries because they tend to not teach you anything, so I built my own. I'll probably Release it on my website soon.

                    BTW, don't get so carried away with the "hype" and the way people talk about AJAX, how many times do i have to see "oh this new technology called AJAX"... NO--- It's not a technology, it's nothing new except that it now has a name. It use to be done with Iframes, and later with XMLHttpRequest and ActiveXObject, but the fact is, people overrate it. It's nothing other than doing stuff without refreshing the page. So please don't talk and act like as if it's a new language. The fact that the code can't even change from someone elses code by much is the reason why i say it's not that big a subject. I mean I can make a code, and so can 9 other people but basically will be the same exact AJAX code.

                    Here are some tutorials (i'll put more up soon):

                    AJAX POST Tutorial - POST method
                    AJAX GET Tutorial - GET method
                    AJAX Form fix - Discusses different form elements
                    AJAX htmlentity fix - Discusses the use of htmlentities in the POST/GET strings

                      i think most people are aware its more hype than anything. there are a few cool apps getting around now though.

                      anyway, the best, and probably the simplest tutorial ive read was written by the guy who wrote php. rasmus on ajax.

                        You're right thorpe about the ajax being a hype. Some people are even under the impression it's extremely complicated. Sure it is at first, but once you learn the method and idea, there isn't much you can go on after that.

                        rasmus on ajax though is way too simple a tutorial, i think. But yeah that is probably the easiest to learn.

                          2 years later
                          5 years later
                          cassi;11001171 wrote:

                          I was having the same problem. But I figured out the way. You can do with jquery .ajax. Just send the value onchange to ajax function and further send the value to fetch the new values from the database and print the response. This link may help

                          http://www.x-developer.com/php-scripts/loading-drop-downs-with-ajax-php-and-fetching-values-from-database-without-refreshing-the-page

                          Yeah, considering the thread started in 2005, with the last post in 2007 we can be pretty sure the problem has solved itself by now...

                            Write a Reply...