Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 OnChange event and dynamic URL
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Astralis
Senior Member

USA
1218 Posts

Posted - 03 March 2005 :  02:09:40  Show Profile  Send Astralis a Yahoo! Message
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  Show Profile
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
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 03 March 2005 :  14:20:35  Show Profile  Send Astralis a Yahoo! Message
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

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  06:52:05  Show Profile
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.”
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 04 March 2005 :  13:53:22  Show Profile  Send Astralis a Yahoo! Message
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
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 04 March 2005 :  23:25:40  Show Profile  Send Astralis a Yahoo! Message
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
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 06 March 2005 :  19:34:20  Show Profile  Send Astralis a Yahoo! Message
Bill Wilkinson helped. Thanks!
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 07 March 2005 :  07:58:31  Show Profile
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.”
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 07 March 2005 :  15:17:52  Show Profile  Send Astralis a Yahoo! Message
Not bad - a little bit complicated for what I was doing. Wilkinson's solution was quick and simple: View solution.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 08 March 2005 :  05:51:20  Show Profile
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.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07