|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Image disabling upon condition
Hello,
I have a jsp page which has an image, which when clicked, does some operation. In the same page, there is a checkbox which when checked should disable the image. All these elements are contained in a form. When the checkbox is checked, im able to disable the image, but immediately the form is being submitted. I do not want the form to be submitted bcoz there are other form elements which needs to be filled in and validated before submit. Why is the form being submitted when the image is clicked? Kindly help... |
|
#2
|
||||
|
||||
|
plz post some code that you already have and tell us the idea of what condition you want to happen...
colton22 ps: plz wrap your code in [ CODE ] [ /CODE ] tags |
|
#3
|
||||
|
||||
|
Yes, viewing the code will provide a better understanding.
Assume this is all Javascript, so don't forget to post your rendered code (the actual HTML that gets displayed in the browser), not your JSP code.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#4
|
||||
|
||||
|
function to do all for ya...
i made a function that will disable or enable something with an id as long as it has the "disable" attribuite...
Code:
var toggle_disabled=function() { //PASS IN ID, ONE AFTER ANOTHER IF WANTED...
for (var x=0;x<toggle_disabled.arguments.length;x++)/*>*/{
if (!window.document.getElementById(toggle_disabled.a rguments[x]).disabled) {window.document.getElementById(toggle_disabled.ar guments[x]).disabled=true;}
else {window.document.getElementById(toggle_disabled.ar guments[x]).disabled=false;}
}
}
colton22
__________________
![]() Hang Out, Listen To Music, Have Fun, and Customize Your Experiance All In One Place! - Colton22's World - This is My World |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Image disabling upon condition |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|