popup for classic ASP

mcrmg
mcrmg used Ask the Experts™
on
Hi,

When ask a question, if only one zone is picked, a popup will show for the following

For a better response time, we recommend that you select more than one zone.

end users must select one of the options, is this doable for the classic asp?  thx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Wayne BarronAuthor, Web Developer
Top Expert 2009

Commented:
what exactly are you asking?
If this same thing can be accomplished in ASP? Sure it can, but with use of AJAX would help.

Is that what you are asking?

Carrzkiss

Author

Commented:
yes, if asking a question on this site, the popup is used if only one zone is selected.


Is there a sample code for the classic asp?  thanks
Wayne BarronAuthor, Web Developer
Top Expert 2009

Commented:
ASP is not really what you need, it is more along the lines of possibly Javascript
That will do this.
I tried to do a quick search through google but was not successful in finding anything.

Have the question re-zoned to have
Javascript
AJAX
Added to the zones, as I think that is going to be your best bet in getting this answered quickly.

Carrzkiss
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Multitechnician
Top Expert 2014
Commented:
hello mcrmq,

Try :


<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	function checkZones() {
		z = document.getElementsByTagName('input');
		q = 0;
		for(var i=0;i<z.length;i++)
			if((z[i].name=="zone")&&z[i].checked) q++;
		if(q<2)
			return confirm("For a better response time, we recommend that you select more than one zone.");
		return true;
	}
</script>
</head>
<body>
<form action="http://www.experts-exchange.com" method="POST" onsubmit="return checkZones();"> 
Select zone(s) :<br />
<input type="checkbox" id="zone1" name="zone" />Zone 1<br />
<input type="checkbox" id="zone2" name="zone" />Zone 2<br />
<input type="checkbox" id="zone3" name="zone" />Zone 3<br />
<br/>
<input type="submit" value="Submit zone(s)">
</form>
</body>
</html>

Open in new window

Author

Commented:
I was checking out this site an dtry to make this to work, any ideas?  thx
<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/container/assets/skins/sam/container.css">
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js&2.8.0r4/build/animation/animation-min.js&2.8.0r4/build/connection/connection-min.js&2.8.0r4/build/dragdrop/dragdrop-min.js&2.8.0r4/build/container/container-min.js"></script>






<script>

var progressBar = new YAHOO.widget.ProgressBar({
    minValue: 60,
    maxValue: 90,
    value: 75,
    height: 150,
    width: 30
}).render("pbContainer");
 
// This would move it one third progressed
progressBar.set('value',70);
 
// This is out of range, it will be ignored
progressBar.set('value',100);
 
// value is still 70
alert(progressBar.get('value'));  // should show 70
 
 

// Define the callback object for Connection Manager that will set the body of our content area when the content has loaded

var content = document.getElementById("content");

var callback = {
	success : function(o) {
		content.innerHTML = o.responseText;
		content.style.visibility = "visible";
		YAHOO.example.container.wait.hide();
	},
	failure : function(o) {
		content.innerHTML = o.responseText;
		content.style.visibility = "visible";
		content.innerHTML = "CONNECTION FAILED!";
		YAHOO.example.container.wait.hide();
	}
}

// Show the Panel
YAHOO.example.container.wait.show();

// Connect to our data source and load the data
var conn = YAHOO.util.Connect.asyncRequest("GET", "http://www.cnn.com", callback);
</script>

<div id="content"></div>

Open in new window

Commented:
I'm not sure what that last bit of script has to do with the original question?

Your original question was best answered by leakim's snippet of code.

Carrzkiss is right - while you CAN use classic ASP, it doesn't really have any influence on what you're trying to do. The thing you're trying to do is all about Javascript, and you can put Javascript on any web page, whether it was plain HTML, or ASP, or PHP, or whatever. Javascript is the thing that can "see" the web page and interact with it, so it can count the number of zones that have been picked and tell you that you should pick more. Leakim's code does that.
Wayne BarronAuthor, Web Developer
Top Expert 2009

Commented:
Thanks gr8gonzo
It is nice to be recognized by someone every once in a while.

Have a good one.
Carrzkiss
leakim971Multitechnician
Top Expert 2014

Commented:
Thanks for the points!
@gr8gonzo thanks for your comment!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial