473,785 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Input Type Image and disabled

Hi all,

Does IE support disabled for the Image type in inputs? This small
example doesn't seem to work when the type is Image, but perfectly fine
when the type is submit.

Best Regards

<html>
<head>
<title>Lala</title>
</head>
<body>
<script>
<!--
function disable()
{
var button = document.getEle mentById("submi t");
button.disabled = true;
button.style.co lor = "red";
return false;
}
-->
</script>
<form action="world.h tml" onsubmit="retur n disable()">
<input type="image" id="submit" src="Hello" Value="submit
"Alt="Submi t">
</form>
</body>
</html>

Jun 20 '06 #1
3 12494
pe**********@ya hoo.dk wrote:
Does IE support disabled for the Image type in inputs? This small
example doesn't seem to work when the type is Image, but perfectly fine
when the type is submit.
[snip code]


It appears to work (WinXP IE 6.0.29), but the disable-command is not
directly "visible" for the user. The image is just displayed whether
it's enabled or not. It should work for all INPUT-elements (at least in
HTML4.0+) regardless of the TYPE-argument:

http://www.w3.org/TR/html4/interact/forms.html#h-17.12

If you would decide to use the code, maybe you could swap your image to
another one that is more in "disabled-style" when the element is
actually disabled.

Hope this helps,

--
Bart

Jun 20 '06 #2
Bart Van der Donck wrote:
It appears to work (WinXP IE 6.0.29), but the disable-command is not
directly "visible" for the user.


You're right. It actually works, although it doesn't seem so for the
user. if I put in this conditional

....
if(button.disab led == true)
alert("Error");
button.disabled = true;
....

then the alert box never displays. But then there is one thing that
puzzles me: When I use this snippet in an other system I still recieve
double form submissions when testing...

Jun 21 '06 #3
pe**********@ya hoo.dk wrote:
You're right. It actually works, although it doesn't seem so for the
user. if I put in this conditional

if(button.disab led == true)
alert("Error");
button.disabled = true;

then the alert box never displays.
That obviously depends on where you put it in your code. It should work
if you put it just before:

button.style.co lor = "red";

Your 'disable()'-function can be executed only once anyhow - after it's
done, the submit element is left disabled, so you can't execute the
'disable()'-function again.
But then there is one thing that
puzzles me: When I use this snippet in an other system I still recieve
double form submissions when testing...


Well, your code actually prevents form submissions.
You might invoke a processing script twice if you doubleclick on a
submit element. The rule is "one click = one submit".

--
Bart

Jun 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4470
by: Mark | last post by:
Hi, I create a button in the form in the asp page like is: <input type="image" src="button.gif" name="detail" border=0 value="100234"> How can I get this value from another page? I try sdetail = Trim(Request.Form("detail")) response.write(sdetail) But doesn't work Thanks.
4
17257
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would do myDomElement.click and the mouse doesn't matter, but in the case of an input image element, what happens is the submitted url has something like "?x=12&y=7" appended to it (the numbers vary per mouse position on the clicked element). If you hit...
1
21030
by: Wayne | last post by:
Please help... For some odd reason onclick is not working with and <input type="image"> but works fine on an <input type="button">.... This does not work: <input TYPE="image" src="go.gif" onclick="thisthis(form.text1.value,form.select1.value)"> But this works fine: <input TYPE="button" width="20" VALUE="SEARCH" onclick="thisthis(form.text1.value,form.select1.value)">
2
5789
by: Kimmo R. M. Hovi | last post by:
Currently I have defined: -- clip clip -- <form method="post" action="xx" enctype="application/x-www-form-urlencoded"> <input type="image" name="Function 1" src="image1.gif" border="0" title="1">
1
4136
by: Brian Genisio | last post by:
Hi all, I noticed that the image input type does not show up in the elements array (IE 6.0). <FORM name=myForm> <INPUT name=rads id=check1 type=radio value=val1> <INPUT name=rads id=check2 type=radio value=val2 checked> <INPUT name=rads id=check3 type=radio value=val3> <INPUT name=rads id=check4 type=radio value=val4>
2
6603
by: jon | last post by:
Hi This might be an easy one to answer but I have a web form in an ASP.NET 1.1 application with a hand-rolled HTML image button as follows which opens a help guide in a new window: <input type= "image " id= " imgHelp " onclick="javascript:void(window.open('<% Response.Write(ConfigurationSettings.AppSettings); %>')) ">
3
21273
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image' src='picture.gif' name='myimage' id='myimage'> </form> When forms with image types are submitted, the value is not returned; instead, when the form is submitted, the XY coordinates of the where the user clicked on the image are sent. For example, if the user
2
1359
by: wolfing1 | last post by:
So far I've been using instructions like 'if request.form("var.x") <> "" then ...' but then I found that if images are disabled (or not found) and I click on the alt text, then Firefox (or was it IE?) sends a 'var.x=' in the response so my instruction doesn't detect that the 'button' was pressed. Is it safe to change my checks to 'if request.form("var.x").count 0 then ...' instead? does it work for all browser responses and HTML...
8
14254
by: John | last post by:
Hi Pasrt of HTML - <div class='button'><input type='image' src='/images/check1.jpg'></input></div> Part of CSS - ..button {background-image: url(/images/check1.jpg); background-repeat:
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.