469,903 Members | 1,612 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Help ! keyword for the web - javascript

Hi,

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
document.all("HidFrame[delete: lookupframe]").src= "/db.nsf
/CityLookup?ReadForm&state=" + ar;

I want to load the CityLookup page, but it doesn't work.
Do you know why?

Thanks, Lucie.
Jul 20 '05 #1
1 1534
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.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Michael Hagstrom | last post: by
7 posts views Thread by Mike | last post: by
2 posts views Thread by Sudheer Kareem | last post: by
1 post views Thread by john | last post: by
5 posts views Thread by Samik2003 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.