Author |
Topic  |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 03 March 2005 : 02:09:40
|
I have a drop-down menu that has an onchange event to it, but the form executes a different page and I only want it to reload the current page. But, the URL is dynamic.
It could look like this: prodImg.asp?action=edit&upd=XX or prodImg.asp?action=new
Is it possible to do this? |
|
Classicmotorcycling
Development Team Leader
    
Australia
2085 Posts |
Posted - 03 March 2005 : 04:44:57
|
Do you want to share a bit more code as I have a small idea, but don't want to put a heap of code if it is not what I am thinking it is.
|
Cheers, David Greening |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 03 March 2005 : 14:20:35
|
Here is the select:
<SELECT Name="idcategory" MULTIPLE size=10 onChange="document.prodForm.submit();">
Here is the FORM tag:
<form method="post" action="prod_exec.asp" name="prodForm" onSubmit="return checkForm(this);">
When the Select tag onchange triggers the form, it tries to call prod_exec.asp which I don't want to do. I want to refresh the page, but it isn't as simple as putting in the url in the onchange event because as I described above, that URL is dynamic like this:It could look like this:
prodImg.asp?action=edit&upd=XX or prodImg.asp?action=new
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 04 March 2005 : 06:52:05
|
Would a window.location.reload(); not do the trick?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 04 March 2005 : 13:53:22
|
Shaggy,
No. Because to reload the subcategories, it is figuring out which category was selected to determine which subcategories to show by a request.form:
catChosen = Request.Form("CategorySelect") |
Edited by - Astralis on 04 March 2005 13:53:48 |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 04 March 2005 : 23:25:40
|
I was looking at Bill Wilkinson's example. Even he triggers the form action to accomplish this. I have no idea how to refresh it without triggering the form action. Here is his example that I've followed pretty closely. Any idea? Example |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 06 March 2005 : 19:34:20
|
Bill Wilkinson helped. Thanks! |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 07 March 2005 : 07:58:31
|
What I was going to suggest then, was pulling all the subcategories out when loading the page and dropping them into javascript arrays based on their parent category and then using this to populate the dropdown with the necessary subcategories.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 07 March 2005 : 15:17:52
|
Not bad - a little bit complicated for what I was doing. Wilkinson's solution was quick and simple: View solution. |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 08 March 2005 : 05:51:20
|
Hmm ... to me, that seems overly complicated but to each their own. 
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
|
Topic  |
|