how to check the checkbox checked property

hi guyz

i have a server side chkbox control and on the basis of it i want to enable/disable a textbox at client side, i had registered an event in my .cs class, but using java script im unable to chkeck whether the checkBox is checked or not (at client side)

im doing it on  .acx control and i donot have a form object on it. i tried alot but unable to find the solution kindly tell me if any1 knows..........

 

 

thnx

0
zestq
11/4/2007 8:51:38 AM
asp.net.client-side 24353 articles. 1 followers. Follow

3 Replies
713 Views

Similar Articles

[PageSpeed] 45

For a CheckBox this is all that you need. If a CheckBoxList there is a little more involved.

/////////////////////////////////
// aspx file
/////////////////////////////////
<form id="Form1" method="post" runat="server">
 <asp:checkbox id="CheckBox1" runat="server"></asp:checkbox>
<script type="text/javascript">
<!--
function checkBoxOnClick(elementRef)
{
 if ( elementRef.checked )
  alert('CheckBox checked');
 else
  alert('CheckBox un-checked');
}
// -->
</script>
</form>

/////////////////////////////////
// aspx.cs file
/////////////////////////////////

private void Page_Load(object sender, System.EventArgs e)
{
 CheckBox1.Attributes.Add("onclick", "checkBoxOnClick(this);");
}

NC...

0
NC01
11/4/2007 3:41:11 PM

Hi NC01 , thnx for the help, I found the solution

its :

<script type="text/javascript" language="javascript">
    function chkChanged()
    {
        if(document.getElementById("<%=chkBoxOthers.ClientID%>").checked == false)
        {      
            document.getElementById("<%=txtBoxOthers.ClientID%>").disabled=true ;
        }
        if(document.getElementById("<%=chkBoxOthers.ClientID%>").checked == true)
        {
            document.getElementById("<%=txtBoxOthers.ClientID%>").disabled=false ;
        }
    }

</script>

<asp:CheckBox ID="chkBoxOthers" runat="server" onClick="chkChanged();" />

in Code Behind(.cs file)

this.chkBoxOthers.Attributes.Add("onClick", "chkChanged();");

and this would do the work for u :)

0
zestq
11/5/2007 7:13:00 AM

Yeah, as long as the CheckBox and TextBox IDs don't change.

NC...

0
NC01
11/5/2007 12:47:47 PM
Reply:

Similar Artilces:

checking checkbox is checked or not using checkbox.checked
Hi,my checkbox is<asp:CheckBox ID="Chkcity" runat="server" Text="My own city"  OnCheckedChanged="EventHandler"/>code behind: Private Sub Chkcity_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chkcity.CheckedChangedif (Chkcity ...............)end if End SubERROR    'EventHandler' is not a member of 'ASP.bpoaddjob_aspx'.    Please Mark the post as "ANSWER" if it helps you I think it should be like this:<asp:CheckBox ID="Chkcity"...

Check All Check Box While Check Header CheckBox
 hello...I have two grid on same page...both grid contains header checkbox and item checkbox i want that if use check header checkbox then all item check box checked,i have javascript for this functinality but problem is that when i click on header check box of first grid then checkbox of second grid also checked that i dnt want i want to perform this operation on one grid at one time.i have attache my script also...plz help me....thanks<script type="text/javascript">        function SelectAll(ID)      &nbs...

Check One CheckBox To Check All CheckBoxes
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked. I set the AutoPostBack property of the CheckBox in the Header to True & am invoking a sub named CheckAllRows on the CheckedChanged event of this CheckBox. The CheckBox in the Header exists within the HeaderTemplate of a TemplateColumn in the DataGrid & the rest of the CheckBoxes reside within the ItemTemplate of the same TemplateColumn. This is the code (the ID of the CheckBox in the Header...

Checkbox checked at client side???
Hi, I have a datagrid. In this datagrid At each row I have a checkbox to select the whole row. The second column is a bound column and it keeps the id of the product, the third contains the name of the product and so on... I want to get the id of the product as soon as i check the checkbox. However,this should be handled in client side. Can anyone help me? Thanks... Implement the ItemDataBound event of the grid and make sure ID of the row gets passed to the client side onclick event handler of the checkbox.Bug [MCSD] I'm sorry but I could not manage to implement ItemDataB...

Check In/Check out
I am using PowerBuilder 9. The undo check out is right next to the check in. This is a big problem! I so easy to select Undo check out and lose all of your changes. I lost 8 hours of work yesterday because of it. I know I should be more careful. However, there should be a "Are you sure" some where also. PLEASE FIX!!!!!!!!!!!!! -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ This isn't the tech support line, it's an end-user forum. If you want to report a bug, use CaseXpress and either open a case or report a bug ...

Check-in/Check-out
I'm having some difficulty with powerbuilder's check-in/check-out operation. When I check an object back in, the .pbl the object is being moved from is destroyed. Has anyone else experienced this and is there a fix? Cheers, Tom Thomas F. (Tom) Massey wrote: > > I'm having some difficulty with powerbuilder's check-in/check-out > operation. When I check an object back in, the .pbl the object is > being moved from is destroyed. > > Has anyone else experienced this and is there a fix? > > Cheers, > > Tom The prob...

Check out/check in
Hello How can i use the process check out/check in in PowerBuilder 8.0.3 ? We work in network. The Source Control is PB Native. I don't understand what is the parameters of Source Control ? Thank you Have you looked the PB8 User's guide? Chapter 3 talks about source control. -- Evita Chapa Senior Systems Analyst II Command Technologies Inc. <Herv� Bareth> wrote in message news:3f69ba0a.592b.846930886@sybase.com... > Hello > > How can i use the process check out/check in in PowerBuilder > 8.0.3 ? We work in network. The Source Control is PB Na...

Check in
Hi all. I am migrating from PB 7.0 to PB 10.5, After migrating my first application i am trying to work on my first window but i'am not able to find out the way to CHECK it OUT. Wher do i can find "check out/check in" functions ?? TIA Mario Parietti What source control are you using? Have you configured it? Right click on your Workspace and check the source control tab to see if you've got it set up. "Mario Parietti" <mparietti@intercad.ch> wrote in message news:451283e0$1@forums-1-dub... > Hi all. > I am migrating from PB...

Check In Check Out
I have some source code that I need to modify and it was sent to me in a Registered status. Therfore, when I open any object it says " 'object name' is registered but not checked out and therefore can not be overwritten. Open anyway?" Then when I try to check it out, I get "PBNative checkout not allowed for registered objects." How can I get around this? When I look under the "Source" menu, all the items concerning registered are grayed out. TIA Option1:Copy the object(Only) to someother pbl and try . Option2:If You have any SCC Expo...

Check out/check in
Hello How can i use the process check out/check in in PowerBuilder 8.0.3 ? We work in network. The Source Control is PB Native. I don't understand what is the parameters of Source Control ? Thank you Better to ask this in the source control group. Lots of posts on PBNative -- Evita Chapa Senior Systems Analyst II Command Technologies Inc. <Herv� Bareth> wrote in message news:3f69678e.7b3a.846930886@sybase.com... > Hello > > How can i use the process check out/check in in PowerBuilder > 8.0.3 ? We work in network. The Source Control is PB Native. ...

Checked=Checked
 I am dynamically writing out checkboxes on a page.  I have 2 link buttons on the page that sets a boolean variable to True or False. This boolen is set in Page_PreInit and is used to Select or Deselect all the Checkboxes as they are written out. A Select ALL, Deselect ALL type of thing. At least that is the plan. As the page is being written out I do this for each checkbox and then add it to a table cell control that it added to a table row and on. tc is the table cell.  Dim chkItem As CheckBox = New CheckBox chkItem.ID = "chkRecommend" + drMember("ID")...

checkbox client side onclick event to manage checked status of multiple checkbox controls or multiple items in a checkboxlist
I want to use javascript to run a client side function to manage the checked state of multiple checkbox controls.  For example, if checkboxA is checked by the user, I want to uncheck checkboxB & checkboxC and check checkboxD.  I do not want to make this a postback event. Also, I'm considering using a checkboxlist control.  If I were to use a checkboxlist control with 6 list items, how would I control the checked status of the different list items based upon an onclick event for one of the list items.  An example: if checkbox list item (1) is checked, I want to unc...

Checkbox List Check/Uncheck All Client Side
I have developed several web forms that include checkbox lists and radiobutton lists whose text and value fields are generated from a SQL Database table. I now would like to create a button or checkbox that will select and deselect the checkboxes on the client side. I have looked into the scripts that cycle through individual checkboxes and change their selected value based on their name, but the problem there is that checkbox lists automatically create individual names for each checkbox in the list - for example: I have a checkbox list with ID="cbxCardio" The names generated f...

Check to see if Checkbox is checked
  Hello All, Currently my application allows user to select the days which they worked and the days are presented in the form of checkboxes which means there are 7 checkboxes for Monday to Sunday. The problem is: I want my users to at least check one box: How do I write the code in VB.NET to ensure that at least one box is checked? I have no totally no idea at all.  Any experts care to shed some light? Thanks!Sincerely Yours, Abupapa hi,Pls go through the link below: This is a very good article.. i think this will meet your requirement.http://codeclimber.net.nz/archive/2007/0...

Web resources about - how to check the checkbox checked property - asp.net.client-side

Checkbox - Wikipedia, the free encyclopedia
In computing , a checkbox ( check box , tickbox , or tick box ) is a graphical user interface element ( widget ) that permits the user to make ...


XYplorer adds flat select tool, timestamping, sticky checkbox selection and improves portable device ...
... them a date previously copied to the clipboard. sc_* - *.doc matches both files beginning sc_ and those with a .doc extension. Sticky checkbox ...

Beware of checkbox marketing!
... able to sell the product at all and the company will go out of business. (sometimes in those exact words) These are the two edges of the checkbox ...

Disable Lion’s Resume Checkbox When Shutting Down [Video How-To]
One of the most annoying features in OS X Lion for me has been the little checkbox on the shutdown dialog box that states, "Reopen windows when ...

A Checkbox On Your Tax Return Helped Kill Public Campaign Funding
You already hate tax season, and as you move wearily through the cold calculations of the 1040 form, you come across a familiar checkbox. It’s ...

Google's Clever Plan to Replace CAPTCHA With a Checkbox
CAPTCHAs are an unfortunate side effect of the internet. They're those irritating collection of numbers and letters morphed into some Surrealist ...

Great news: New EEOC checkbox category emerges
"Bow-tie'n white boys"? Hey, I tried to anticipate the next expansion in ethnic categorization yesterday with my proposal for recognition of ...

Checkbox Syndrome: Why We Spend Money on Things We Don't Need
Ever been overwhelmed by the temptation to buy the latest shiny thing because it's got another checkbox in the features column? We call this ...

Magid: Google ditching CAPTCHA for 'I'm not a robot' checkbox
We need better security, but we need to find systems that are hard for bad guys to break but easy for good folks to use. Google is one of the ...

Resources last updated: 11/25/2015 12:58:41 AM