Solved

Auto Submit on dropdown box

Posted on 2016-10-30
3
57 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
ID: 41866445
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
ID: 41866447
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
ID: 41866455
[code]If Request.Form("championship") <> "" Then[/code] worked perfectly!

Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now