View Single Post
  #3 (permalink)  
Old April 12th, 2005, 09:20 AM
crmpicco crmpicco is offline
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco

yes i do want it to only occur under a condition, but i would kind of need it to be done with HTML, Javascript, ASP or whatever.

I think it can be done with ASP.NET, but I have yet to see it be done anywhere on the WWW with Classic ASP.

Thanks for all your help guys, have you got any other ideas?

Can it be done with javascript?

I found this page, but dont really know what the guy is trying to say:


> <div id=s1 disabled>
> <button onclick="alert('1')">click me</button>
> <button onclick="alert('2')">click me</button>
> <button onclick="alert('3')">click me</button>
> </div>
> When I open this code in IE6 the buttons indeed appear grayed out
> (disabled), but surprisingly - they do respond to clicks, despite
> MSDN's explicit declaration...

That won't work in any browser other than IE. It's also invalid HTML.

> Does anybody know how can I still control the buttons state or
> enable/disable their mouse events in one command?

Use your original HTML and:

if( !document.getElementById ) {
if( document.all ) {
document.getElementById = function( id ) {
return document.all[ id ];
} else {
document.getElementById = function() {
return null;
function enableGroup( prefix, num, bool ) {
bool = bool || true;
for( var i = 1, e; i <= num; ++i ) {
e = document.getElementById( prefix + num );
if( e ) e.disabled = !bool;

calling the function

enableGroup( 'b', 3 )
enableGroup( 'b', 3, true )

to enable b1 through b3 and

enableGroup( 'b', 3, false )

to disable b1 through b3.


I have this setup:


<% if crm = true then %>
<div id="crm" disabled>
<img src="banner_vr.gif">
<% end if %>

But, i would like the image disabled or greyed-out if the ASP conditon is met as you mentioned. But as i say there are many images and this image will change every time (like eBay for example).

(the image in left hand corner)

Any help is greatly appreciated!
Reply With Quote