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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I have a prob within my scri

Status
Not open for further replies.

JeroenB

Programmer
Apr 8, 2001
93
BE
Hi,

I have a prob within my script;
namely;
I have three select boxes in my page, which are connencted in a way to each other; Everything seems to work ok as long as I have values within these three boxes. The problem is that it can be possible that I only have to use 2 of the 3 (so I do not have any "parts"). When doing so, the third box should be resetted (because now the last value remains standing there as it has not been replaced with another one...)
How can I add this to this script ?

Thanks in advance
JeroenB




<HTML>

<HEAD>
<TITLE>Pavilions_list</TITLE>

<SCRIPT Language=&quot;JavaScript&quot;>
<!--

function Localidades(form)
{
form.pavilion.length = 1;
form.pavilion.selectedIndex = 0;
val_sec = form.section.options[form.section.selectedIndex].value;
if (val_sec == &quot;be&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Atomium&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Atomium&quot;;
}
if (val_sec == &quot;be&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Aluminium&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Aluminium&quot;;
}
if (val_sec == &quot;be&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Cheerful Belgium&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Cheerful Belgium&quot;;
}
if (val_sec == &quot;be&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Couture&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Couture&quot;;
}
if (val_sec == &quot;fo&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Brazil&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Brazil&quot;;
}
if (val_sec == &quot;fo&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Austria&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Austria&quot;;
}
if (val_sec == &quot;fo&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Cambodia&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Cambodia&quot;;
}
if (val_sec == &quot;fo&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Canada&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Canada&quot;;
}
if (val_sec == &quot;co&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Fauna&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Fauna&quot;;
}
if (val_sec == &quot;co&quot;)
{
(form.pavilion.length)++;
form.pavilion.options[form.pavilion.length - 1].text = &quot;Hall of Congo & Ruanda-Urundi&quot;;
form.pavilion.options[form.pavilion.length - 1].value = &quot;Hall of Congo & Ruanda-Urundi&quot;;
}


}

function LocIndxValue(forma)
{
forma.LocIndx.value = forma.pavilion.selectedIndex;
return true
}


function Setparts(form)
{
form.part.length = 1;
form.part.selectedIndex = 0;
val_sec = form.section.options[form.section.selectedIndex].value;
val_pav = form.pavilion.options[form.pavilion.selectedIndex].value;
if ((val_pav == &quot;Atomium&quot;) && (val_sec == &quot;be&quot;))
{
(form.part.length)++;
form.part.options[form.part.length - 1].text = &quot;part01&quot;;
form.part.options[form.part.length - 1].value = &quot;part01&quot;;
}
if ((val_pav == &quot;Aluminium&quot;) && (val_sec == &quot;be&quot;))
{
(form.part.length)++;
form.part.options[form.part.length - 1].text = &quot;part02&quot;;
form.part.options[form.part.length - 1].value = &quot;part02&quot;;
}
}

function PartIndxValue(forma)
{
forma.PartIndx.value = forma.part.selectedIndex;
return true
}
//-->
</script>

</HEAD>

<BODY BGCOLOR=&quot;#FFFFFF&quot; LINK=&quot;#0000FF&quot; TEXT=&quot;#0000FF&quot; VLINK=&quot;#00FF00&quot; ALINK=&quot;#00FFFF&quot;>

<CENTER>
<TABLE BORDER=&quot;0&quot; WIDTH=&quot;98%&quot; CELLSPACING=&quot;2&quot; CELLPADDING=&quot;2&quot;>
<TR>
<TD VALIGN=&quot;top&quot; ALIGN=&quot;left&quot;>
<FORM METHOD=&quot;POST&quot; ACTION=&quot;ATM.asp&quot; NAME=&quot;formulario&quot;>
<FONT FACE=&quot;Arial&quot; SIZE=&quot;3&quot; COLOR=&quot;#0000FF&quot;>
<P ALIGN=&quot;justfy&quot;>
<CENTER>section
<SELECT NAME=&quot;section&quot; OnChange=&quot;Localidades(this.form)&quot; WIDTH=&quot;250&quot;>
<OPTION VALUE = &quot;&quot;>[select]</OPTION>
<OPTION VALUE = &quot;be&quot;>Belgian section</OPTION>
<OPTION VALUE = &quot;fo&quot;>Foreign section</OPTION>
<OPTION VALUE = &quot;co&quot;>Congo-Ruanda-Urundi</OPTION>
</SELECT>
pavilion
<SELECT NAME=&quot;pavilion&quot; WIDTH=&quot;250&quot; OnChange=&quot;Setparts(this.form)&quot;>

<OPTION VALUE = &quot;&quot;>[select]</OPTION>
<OPTION VALUE = &quot;&quot;>000000000000000000000000</OPTION>
</select>
part
<SELECT NAME=&quot;part&quot; WIDTH=&quot;250&quot; OnChange=&quot;PartIndxValue(this.form)&quot;>
<OPTION VALUE = &quot;&quot;>[select]</OPTION>
<OPTION VALUE = &quot;&quot;>000000000000000000000000</OPTION>
</select>
</CENTER>
</P>
</FONT>
</FORM>
</TD>
</TR>


</TABLE>
</CENTER>

<SCRIPT LANGUAGE = &quot;JavaScript&quot;>
<!--
document.formulario.pavilion.length = 1;
document.formulario.part.length = 1;

// -->
</SCRIPT>

</BODY>

</HTML>
 
without bothering to read your post, I am replying to
say that it is lame to post a message with a subject like that.

The subject should allow someone that can help you to tell that the question is in his range of interest, and to allow anyone with similar questions to benefit from your question.

A topic like &quot;help, it doesnt work&quot; is completely useless in this realm. Yo no tengo me gusto
huevos verde E jammon,
Yo no tengo mi gusto, Sam Yo Soy
 
Hi,

You 're totally right; but if you looked a little bit closer to my subject; you also could have noticed that the subject is the same as the first sentence of my issue;
In other words : when you forget to add a subject, this happens !!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top