473,388 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

toggle function not using a checkbox

3
i have the following but would like to use a img button rather than a checkbox - is this possible?

Expand|Select|Wrap|Line Numbers
  1.       function toggleZoom(isChecked) {
  2.         if (isChecked) {
  3.         map.enableScrollWheelZoom();
  4.       } else {
  5.         map.disableScrollWheelZoom();
  6.       }
  7.     }
currently the input is:

[HTML]<input type="checkbox" onclick="toggleZoom(this.checked)" id="scrollWheelZoomToggle" value="" />[/HTML]

but i'd like to use this for example (which doesnt work):

[HTML]<input type="image" id="scrollWheelZoomToggle" src="/images/mapmenu_03.gif" width="114" height="25" value="" onClick="toggleZoom(this.checked)">[/HTML]
Jul 14 '07 #1
3 1646
gits
5,390 Expert Mod 4TB
hi ...

of course ... your toggle-function has to be adapted with the following:

1. pass the current img-src to the toggle-func.
2. check wheter the src is the unchecked or checked one
3. set the counterpart-img-src
4. ... your code follows here

alternativly you may use a custom attribute to store the checked-value ... but note: that makes the (X)HTML invalid ... but it would work ;)

hope i made the idea clear enough ...

kind regards
Jul 14 '07 #2
mrlk
3
i'm sorry but i havent a clue what you mean... :(
Jul 14 '07 #3
gits
5,390 Expert Mod 4TB
using an image instead of a checkbox you have to simulate the ceckbox-behaviour ... or not? i think you have a pic for unchecked and one for checked state of the control, so that the user has feedback on clicking the image? ... so onclick you have to change the src of the image. the image-src now is your checked-attribute that you may ask instead of the checked-property of the original checkbox ...

kind regards
Jul 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Alan Carpenter | last post by:
I'm not a Newbie but I feel like one right now. Here's what I did to reproduce a simple, simple problem. 1. Create a new Database. 2. Create a new Form. 3. Create a CheckBox on the form....
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
4
by: deko | last post by:
Basic question about checking the value of Toggle/Check/Combo/OptionGroups.... Checking like this: If Me!chkCheckBox Then ... End If and like this:
1
by: sam | last post by:
Hi All, I have a form with 4 checkboxes and 4 text boxes and one submit button. The form should work such a way when I select a particular checkbox and give a url in text box, the form should...
2
by: John Smith | last post by:
How can I use a transparent command button to change a checkbox? I have my records set up in a continuous form and I want theuser to be able to click on the record and have this toggle the...
6
by: plumba | last post by:
Hi I have a check box which when ticked displays the sumit buttons of a form and gives the checkbox field a value of "agree". I would like to set the check box to hide the section of the form...
4
by: zufie | last post by:
I have two checkboxes on a form, ChckIBCCP and ChckOtherReferral. Each checkbox highlights its respective textboxes and combo boxes on the form. Many of the highlighted textboxes and combo...
4
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img...
1
by: student4lifer | last post by:
Hello, I currently have a hyperlink to toggle the node, showing and hiding the list. Could someone show me how to use a checkbox instead of the hyperlink to do the same thing? Thanks. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.