Solved

Auto Submit on dropdown box

Posted on 2016-10-30
3
32 Views
Last Modified: 2016-10-30
Hi there, I have created an auto submit for a dropdown box, however running into some issues...

The issue is the page submits, but doesnt go to the Request.Form I want it to (below)

In another question (https://www.experts-exchange.com/questions/28979728/Auto-Submit-on-dropdown-box.html) They have mentioned that I 'need to alter the ASP code to detect when the select list value has changed and redirect accordingly.'

Unfortunately, this is where i am lost :(
<%
If Request.Form("go")="Go!" Then
	oConn.Execute("INSERT INTO site_log(log_session,brand_ID,log_page,log_date,log_time) VALUES("&Session_ID&",'"&SubDomain("brand_ID")&"','Show "&Request.Form("championship")&"','"&Date()&"','"&Time()&"')")
	Set Championship=oConn.Execute("SELECT * FROM codes WHERE code_name='"&Request.Form("championship")&"'")
	Response.Redirect("?code="&Championship("code_short"))
Else
' cut from code
%>
	<td width=330 height=40 nowrap align=middle>&nbsp;&nbsp;<select name=championship class=inputbox onchange='this.form.submit()'>
	<option>Select Championship</option>
	<option>---</option>
	<option>Championship("code_name")</option>
	</select><noscript><input type=submit value=Go! name=go class=inputsubmit></noscript></td>
<%
End If
%>

Open in new window


Any help is appreciated
0
Comment
Question by:Graeme
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
Comment Utility
try change:

If Request.Form("go")="Go!" Then

Open in new window


to:

If Request.Form("championship") <> "" Then

Open in new window


or:

If Request.Form <> "" Then

Open in new window

0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
also... what's your <form> tag looks like? is it post to the same page or another different page?
0
 

Author Closing Comment

by:Graeme
Comment Utility
[code]If Request.Form("championship") <> "" Then[/code] worked perfectly!

Thank you!
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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

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