Solved

Auto Submit on dropdown box

Posted on 2016-10-30
3
74 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 50

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 50

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

776 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