Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: listbox jump


Message #1 by "Daniel O'Dorisio" <dodorisio@h...> on Fri, 11 May 2001 23:23:13 -0400
i got it..
i used
window.location = "quiz.asp?id=" +
document.forms["selectquiz"].whatquiz.value

and it works..

Daniel

-----Original Message-----
From: Phil Griffiths [mailto:pgtips@m...]
Sent: Monday, May 14, 2001 1:14 PM
To: javascript
Subject: [javascript] Re: listbox jump


Doesn't seem to be anything wrong with your code - its the standard way of
getting a listbox's value.  Could be something as simple as a typo.  Try
giving the Form a Name/Id attribute and using that instead of forms[0].
Also check the Name/Id attribute of the select element and make sure it is
'whatquiz'.  Finally, I don't think list is a reserved word but you could
try changing that variable name.

Sorry its a bit vague but like I say it looks OK and I've definitely seen
stuff like this working.

If all else fails post the whole page.

Phil
> hey there.. can you please help me..
> i am having trouble with a litsbox jump.. i have asp populate the listbox
> with quiznames and the id of the quiz. then i want the onchange event to
> redirect the page to the proper page based on the selection.. but, the
page
> it redirects to is actually the same page, just with a different
quizid...
> is that understandable?? so on quiz.asp i have a listbox that list the
> quizs' then once one is selected it will redirect to quiz.asp?quizid
value
> of the selected index.. but i cant seem to get it working.. the code i
> tried:
>
> function navigate() {
> 	var list = document.forms[0].whatquiz
> 	location = list.options[list.selectedindex].value
> }
>
> this only got me an error saying options is not an object... i know this
> wouldnt work correctly.. since i dont have the full url in there.. it
will
> just jump to the quiz id.. but i was thinking that if i could get this to
> work.. i would be able to do the other..
>
>
> TIA!!
>
> Daniel
>

  Return to Index