Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Exclamation Chain Selects Won't Work in Existing Form

    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.

    The page is here. 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.

    The options are all in the exampleconfigtest.js which is designated in the head of the page.

    any help is appreciated.

    thanks
    kristin

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    You have inline statements addressing the form myform before it is rendered. It looks as though they were intended to be part of
    radio_onload, but have been left out of it.

    Use the error console.

  • #3
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts

    i have tried this

    and i cannot seem to get a solution.
    maybe i misunderstand you?
    the error console doesnt seem to help.

  • #4
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by kristingish View Post
    and i cannot seem to get a solution.
    maybe i misunderstand you?
    the error console doesnt seem to help.
    It's an immense help:
    Error: document.myform is undefined
    Source File: http://www.hunterauto.com/techquestiontest2chained.html
    Line: 83
    Code:
      function radio_onload()
          {
          document.myform.CustomerRadio1.value="0";
          document.myform.C1.value="OFF";
          } // <- Function ends here
    
      /* All subsequent statements are not within a function,
    and therefore execute as soon as this script block is rendered,
    which is prior to the rendering of the form to which they refer */
    	  {
          document.myform.CustomerRadio1.value="1";
          document.myform.C1.value="OFF";
          }
    	  {
          document.myform.MyRadio.value="0";
          document.myform.C1.value="OFF";
          }
    .................................

  • Users who have thanked Arty Effem for this post:

    kristingish (06-18-2008)

  • #5
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts
    oh.. my gosh.

    thank you. im going to work on it right now!

  • #6
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Exclamation

    i have revised the code to now read as:

    Code:
    <script language="javascript">
          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";
          }
    	  
          </script>
    but my form chain select boxes still do not populate with the data options i designated in the confi js file.

    any other suggestions?

    thank you

    kristin

  • #7
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by kristingish View Post
    i have revised the code to now read as:
    ...........

    but my form chain select boxes still do not populate with the data options i designated in the confi js file.

    any other suggestions?
    Same suggestion as before: Read the error console which has more to tell you.

  • #8
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Hi, I don't mean to be unappreciative or anything.
    It's just that I used dreamweaver to validate the page and i went through all of the errors and none of it worked. The only error related to my chain selects was the location of where i called on the javascript and fixing that didn't make them work.

    if anyone has any idea what i could possible do i would really appreciate it.. very much.

    sorry to be such a pain but im at the end of my rope here.

  • #9
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by kristingish View Post
    Hi, I don't mean to be unappreciative or anything.
    It's just that I used dreamweaver to validate the page and i went through all of the errors and none of it worked. The only error related to my chain selects was the location of where i called on the javascript and fixing that didn't make them work.
    The error console (in FireFox) is found in the Tools menu. Click the 'Errors' button if not already down. It's saying 'ie' is undefined. You're testing a variable that isn't defined anywhere.

    <body onload="if (ie||ns6||ns4) {

    If this is a remnant from an abandoned script, then remove it, otherwise include whatever code creates those variables.

  • #10
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Well there was more than one problem

    Although I still have not figured out what you were explaining... I did find a fix to make the chained selects populate in Firefox. The conditional areas at the top of the form work just great in both Firefox and IE but the selects wont populate in IE and I am still lost. I realize I'm in way over my head but i didn't get this far just to give up.. even if i AM in way over my head.

    Can anyone help me.

    the page is at http://www.hunterauto.com/techquestionschained.html

    thanks so much
    kristin

  • #11
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by kristingish View Post
    Although I still have not figured out what you were explaining... I did find a fix to make the chained selects populate in Firefox. The conditional areas at the top of the form work just great in both Firefox and IE but the selects wont populate in IE and I am still lost. I realize I'm in way over my head but i didn't get this far just to give up.. even if i AM in way over my head.

    Can anyone help me.

    the page is at http://www.hunterauto.com/techquestionschained.html
    The currently-indicated error is that ie is undefined. This test is unnecessary so change
    Code:
    function handleLoad () {
    	initListGroup('Products', document.forms[0].make, document.forms[0].type, document.forms[0].model);
    	if (ie||ns6||ns4) {
    	regenerate2();
    	updatecontent();
    	}
    }
    to
    Code:
    function handleLoad () 
    {
     initListGroup('Products', document.forms[0].make, document.forms[0].type,  document.forms[0].model);
     regenerate2();
     updatecontent();
    }
    This may not fix the problem but it clears the error so you can move on.

  • #12
    New Coder
    Join Date
    Jun 2008
    Location
    Normal, IL
    Posts
    45
    Thanks
    3
    Thanked 3 Times in 3 Posts

    IE: Undefined

    Hi Arty,

    I thoroughly appreciate your patience with me.

    I was lucky enough to come across and updated configuration file published by the creator of the Chained Selects code that I had used, which fixed the problem I was having with the selects not populating. This required no change in the coding on my page.

    Afterwards, I did end up doing as you suggested by switching the code as you had said :
    This may not fix the problem but it clears the error so you can move on.
    The problem though is that it recreated the original problem of my chained selects not being populated. So, for now I guess iw ill let that part of the problem just rest.

    I cannot expect a respectable end product from such a quickly thrown together mess of code that I created myself with such a lack of knowledge to begin with.

    In this case I am starting to think scrapping the whole thing is the best idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •