Solved

Refresh page onChange event of listbox

Posted on 2004-04-26
6
1,444 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
Comment Utility
<select onchange="self.location.reload()">
0
 
LVL 22

Accepted Solution

by:
neeraj523 earned 50 total points
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 22

Expert Comment

by:neeraj523
Comment Utility
Helloo DoDo1975

no inputs for this question..

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

neeraj523
0
 

Author Comment

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

Expert Comment

by:neeraj523
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now