Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1491
  • Last Modified:

Refresh page onChange event of listbox

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
DoDo1975
Asked:
DoDo1975
1 Solution
 
hongjunCommented:
<select onchange="self.location.reload()">
0
 
neeraj523Commented:
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
 
lionellim83Commented:
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
Technology Partners: 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!

 
neeraj523Commented:
Helloo DoDo1975

no inputs for this question..

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

neeraj523
0
 
DoDo1975Author Commented:
How do I close it without accepting an answer?
0
 
neeraj523Commented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now