...

View Full Version : Chain Selects Won't Work in Existing Form



kristingish
06-16-2008, 08:17 PM
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. (http://www.hunterauto.com/techquestiontest2chained.html) 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

Arty Effem
06-16-2008, 10:08 PM
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.

kristingish
06-18-2008, 01:51 AM
and i cannot seem to get a solution.
maybe i misunderstand you?
the error console doesnt seem to help.

Arty Effem
06-18-2008, 03:00 AM
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



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";
}
.................................

kristingish
06-18-2008, 03:04 AM
oh.. my gosh.

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

kristingish
06-18-2008, 03:21 AM
i have revised the code to now read as:


<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

Arty Effem
06-18-2008, 04:10 AM
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.

kristingish
06-18-2008, 07:45 PM
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.

Arty Effem
06-18-2008, 09:27 PM
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.

kristingish
10-04-2008, 04:19 AM
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

Arty Effem
10-04-2008, 04:42 AM
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


function handleLoad () {
initListGroup('Products', document.forms[0].make, document.forms[0].type, document.forms[0].model);
if (ie||ns6||ns4) {
regenerate2();
updatecontent();
}
}
to


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.

kristingish
10-04-2008, 08:08 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum