Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chained Select Won't Populate in FORM

Status
Not open for further replies.

kristingish

Programmer
Jun 6, 2008
2
Hi,

I used a Chained Select Box script from Dynamic Drive to save some space on my forms page.

Using the example page that came with the script, I entered all of the information I would want, customizing all of the list/options. It worked great.

When I try to move it over into my pre-existing form.. nothing shows up in the select boxes. I am very confused.

http://www.hunterauto.com/techquestiontest2chained.html"]The page is here.[/URL] I would post the code but I wouldn't even know at this point which parts to post. I don't know if my other scripts are just ... overriding this? or what the problem could be.

any help is appreciated.

thanks
kristin
 
The problem is around line 80 in your page. You have closed the function called radio_onload() by placing the closing } in there... which then causes the rest of that code to attempt to run as the page is still loading (so the HTML hasn't even been loaded into the DOM yet). I guess there was some kind of copy-paste error... but I would look at the original and see what went awry.

Code:
...
      function radio_onload()
      {
      document.myform.CustomerRadio1.value="0";
      document.myform.C1.value="OFF";
[!]      }[/!]
	  {
      document.myform.CustomerRadio1.value="1";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.MyRadio.value="0";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.MyRadio.value="1";
      document.myform.C1.value="OFF";
      }
	 {
      document.myform.MyRadio.value="2";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.MyRadio.value="3";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.MyRadio.value="4";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.HandleRadio1.value="0";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.HandleRadio2.value="1";
      document.myform.C1.value="OFF";
      }
	  {
      document.myform.HandleRadio3.value="2";
      document.myform.C1.value="OFF";
      }
...

I used Firefox with the Firebug extension loaded (an essential part of any web developer's toolbox regardless of the OS you choose to use - check it out if you haven't already)... it threw a couple of JS errors... so it could be you have other problems to fix once you are done.

Cheers,
Jeff

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top