?
Solved

Refresh page onChange event of listbox

Posted on 2004-04-26
6
Medium Priority
?
1,477 Views
Last Modified: 2008-01-09
I have a listbox on a page, I want to refresh the page (to populate another listbox) when the user changes the value of this listbox.  I cant seem the get the right onChange event to make it work.

Any help?
0
Comment
Question by:DoDo1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 10924313
<select onchange="self.location.reload()">
0
 
LVL 22

Accepted Solution

by:
neeraj523 earned 150 total points
ID: 10925692
Helloo

Try this..

===================================================
<SCRIPT Language="JAVASCRIPT">
function refreshPage(obj)
{
  str = obj.value
  location.href = "urPage.asp?id=" + str
// This will call same page with a value selected in list 1 to populate secodn list box..
}
</SCRIPT>

<select onchange="refreshPage(this)">
</select>

<%
if Request.QueryString("id") <> "" Then
%>
<select name="seondlistbox">
</select>
<%
End if
%>
====================================================

hope it will work for u..

neeraj523
0
 
LVL 1

Expert Comment

by:lionellim83
ID: 11064276
To my knowledge, I don't think you can do that unless you set a timer and request for the listbox to be updated every few seconds which would be impractical - too much traffic. I would put a refresh button next to the list box. Before the user selects a value, he/she may click on the refresh button to verify that the list is up to date. Within the code for the list box, insert an onchange=refresh() and insert the following code to the top of code together with all the other functions.

<script type="text/javascript">
function refresh()
  {
    location.reload()
  }
</script>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:neeraj523
ID: 11471732
Helloo DoDo1975

no inputs for this question..

Either close this question or ask experts for any further issues..

neeraj523
0
 

Author Comment

by:DoDo1975
ID: 11473841
How do I close it without accepting an answer?
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 11477629
Hello

I am wondering what else you were looking from experts ?? I guess you already got sufficiant number of solution to ur problem. you should accept a reasonable answer for u out of these solutions..

If still u think.. u r looking for more help.. u can ask experts for further assistance.

Well.. if u r sure.. u want to close this question.. u can add a request in community section to delete this question.. But personally.. i feel it will discourage experts to give u solution in ur future problems..

anyway.. all the best..

good bye

neeraj523

0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question