JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 21st, 2006, 09:05 AM
amieAp amieAp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 2 amieAp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 21 sec
Reputation Power: 0
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...

Reply With Quote
  #2  
Old November 22nd, 2006, 08:31 PM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
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

Reply With Quote
  #3  
Old November 23rd, 2006, 09:42 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
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

Reply With Quote
  #4  
Old November 25th, 2006, 10:13 AM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Image disabling upon condition


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway