lu*************@parexel.com (Lucie) writes:
I've created a form with 2 dialoglist fields: 1 state and 1 city.
I want to select a state, and I need a way to build the city list. In
order to do this, I've used the onChange event (on the state field)
and Javascript.
The script is:
st = this[this.selectedIndex].text
you might mean
var st = this.options[this.selectedIndex].text
You don't use the variable "st" in the following.
document.all("HidFrame[delete: lookupframe]").src= "/db.nsf
document.all is a collection, and is supposed to be used as
document.all[ ... ], not as a function (although it does work).
Is the ID of the element really
"HidFrame[delete: lookupframe]"
(it is an illegal ID, they can't contain spaces or square brackets).
/CityLookup?ReadForm&state=" + ar;
I assume the linebreak is inserted by your news client.
You use a variable called "ar" that is not declared here.
Before sending strings as parts of URL's, they should be escaped,
i.e., change "ar" to "escape(ar)".
I want to load the CityLookup page, but it doesn't work.
Do you know why?
From this code, no. There is far too little information, and
we can't test it ourselves without the rest of the page.
You don't even say what happens. "Doesn't work" is not sufficient.
When asking for help with a program that doesn't work, always include:
1) What you did (sufficient code to reproduce problem, which browser to use,
which steps to go through to produce the error).
2) What you expected to happen (otherwise we can't fix the problem, just
nod and say "yes, we get the same").
3) What really happened (in case we can't reproduce the problem).
There is no such thing as too much detail when you are hunting for bugs.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'