my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes Changing the default behaviour for check box ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Changing the default behaviour for check box ?" Watch "Changing the default behaviour for check box ?" New topic
Author

Changing the default behaviour for check box ?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
My code is like this-


the checkbox get it's value from datasrc.

Initially the checkbox is unchecked when the datasrc has value null.

But once i check the box, the value changes to Y. Or if i uncheck the box, the value changes to N.

Question- Even when the datasrc has value null, i want to check the box, so how can i accomplish this ?

My requirement- even when the database has Y or null value, the checkbox should be checked.

Please advise.



SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60786
    
  65

Have you looked at the attributes of the input tag to see if there's something appropriate?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://www.w3schools.com/HTMLDOM/dom_obj_checkbox.asp

Eric
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Actually after putting the post, I immediately opened the w3 school page. Then you also mentioned that page. Thanks for your quick reply. Soon i will let you know, how i solved my problem.
 
wood burning stoves
 
subject: Changing the default behaviour for check box ?
 
Similar Threads
Null ppointer exception when getting the values from the check box
select check all and total the value in a field
getParameter on checkbox returning null even though it's checked!
Accessing invisible checkbox parameter
jsp page checkbox issue