Solved

Refresh page onChange event of listbox

Posted on 2004-04-26
6
1,450 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
6 Comments
 
LVL 33

Expert Comment

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

Accepted Solution

by:
neeraj523 earned 50 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is the normal amount of queries 5 74
Problem to ToolkitScriptManager 2 51
Animated .jpg? 13 57
Randomize in Owl Carousel v1.3.2 6 17
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 Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now