Solved

Auto Submit on dropdown box

Posted on 2016-10-30
3
104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

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 52

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

630 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