SEARCH YOUR SOLUTION HERE  

disable checkboxlist when radio button selected

I've searched and searched, but I cannot find what I'm trying to do...which is...



I have a radiobutton list with 2 items (yes and no) what I need to do is disable an entire checkboxlist when no is clicked and enable when yes is clicked. The other kicker is the radiobutton list needs to be validated (something needs to be selected) and the checkboxlist only needs to be validated when it is enabled.



I'm new to ASP.NET and need a little help as this is the last hurdle in finishing this form page...help :(

Posted On: Tuesday 27th of November 2012 08:45:24 PM Total Views:  275
View Complete with Replies




Related Messages:

Re: How to disable browser caching?   (181 Views)
How would i do that I found some ways on the net like response.expires but it didnt work for me Is their anyway i can achieve this Btw i'm using IE 6.0
disable server-side validation   (218 Views)
Hi. I would like to know if you can turn off server-side validation for validation controls. I read on the MS website that it is true, but I can't find any examples. I know that for the CustomValidator control you can just omit the OnServerValidate property, but what about the other validators I would highly appreciate a small example. I also have a more general question: Can I write validator functions (server side, not JavaScript), turn them off completely on the server and enable them for ALL browsers(including Netscape)
disable buttoncolumn in datagrid   (207 Views)
hi to alli am using a datagrid and i have problems on disabling it.this is how the fields of my datagrid are defined Has you can see i have two columns, "Option" and "File". When i dome.dgrid1.enable = falsethe datagrid should be desable, the problem is that the buttons in the column "Option" workHow can i disable the buttoncolum
how do i disable the internet explorer toolbars   (147 Views)
hello, how do i disable the internet explorer toolbars (address bar icons, status etc.) the thing is i need to do this when i load the internet explorer for the first time so a can't use window.open(args) i need to open a shortcut from a desktop that opens internet explorer without any "bars" please help me,
Enable, disable texboxes on textchange   (178 Views)
:8-0: I'm trying to emulate a client script behavior where textboxs are disabled when user exits a particular textbox. I used the textchange event and it does disable the textbox. My problem stems from the fact that when I click the submit button the textchange event fires and the submit action of searching never fires. This forces me to submit twice. The form has ten texboxes for searching. If a user searches by name, the social security number and other textboxes get disabled. So other then client side scripting how could I implement this using server controls only Or can it actually be done
Enable/disable a form   (213 Views)
I have got my Login on a form.I want to have the form disabled but not the Login textbox.when User eneters a avlue and on checking the value I want to enable the form and then make the Login texbox visible property to false.Tnx
How to programatically disable events   (241 Views)
,I have some code in my webform's Page_Load event that performs some validation when Page.IsPostBack = True. If this validation fails, I don't want to suppress any other event processing from taking place. For example, my page contains a "Save" button with it's CausesValidation property set to True. When this button is clicked, the Page_Load event is fired followed by the btnSave_Click event. If the validatin in the Page_Load event fails, I don't want the btnSave_Click event to be executed.At first I thought I could simply use Response.End to suppress the btnSave_Click event. However this also stopped my page from rendering.Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Page.IsPostBack Then Try Validation() Catch ex As Exception Response.End() End Try End IfEnd SubPrivate Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Save()End SubI then considered using a member variable to track the outcome of the validation. This variable would be checked before executing code in the btnSave_Click event.Code: Private _PageIsValid as BooleanPrivate Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Page.IsPostBack Then Validation() _PageIsValid = True End IfEnd SubPrivate Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If _PageIsValid Then Save()End SubAlthough this should work, it isn't very elegant. There must a better way of accomplishing this using built in ASP.NET functionality. Any suggestions would be appreciated
Re: Combobox disabled when clikc on back button ...   (142 Views)
I have two radio buttons (rb1, rb2) and two comboboxes(webcontrols.dropdownlist, cmb1,cmb2) in asp page(1.aspx) . rb1 is checked and cmb1 is disabled by default, also I add javascript onClick event on each radio button to do this: when user click on rb1 then disable cmd2 and enable cmb1, and vice versa when user click on rb2 then disable cmd1 and enable cmd2. Submit button lead to other page. I click on rb2 (javascript do the job, disable cbm1 and enable cmb2), then I click on submit button and another page shows. Then, finally my problem is, after submitting when click on 'back' in browser (ie) 1.aspx shows again but now rb2 checked and cmb2 disabled instead of cmb2 enabled and cmb1 disabled. At the end, only to mention that 'enableviewstate' is true for page and for all controls. Did anybody have idea why cmb2 is disabled regard j , Originally Posted by MrGTI Could it be that the page is returning back to it's original state - like the way it appears when you first visit the page In that case rb1 should be checked and cmb2 disabled, but now I get rb2 checked and cmb2 disabled. What is wrong !! regard j
disable caching   (217 Views)
I've written some cookies to autologin users on a webpage.If an users logs out, a session variable is set to zero, on each page I check that session and if it's zero you are redirected to login page.On loginpage itself I check if a valid cookie is available and if so, you are redirected into the webpage.so far so good :)This works of course, nasty is only the browser cache. If you are logged in, press logout but call the same .aspx page again after loggin out, IE displaysthe page (even if you can't do anything because you are logged out on server).Can I do anything in asp to tell a browser not to cache data
disable 'view source'   (170 Views)
I dont want users to use 'view source' menu for my webpages.how can i do this
enabled and disabled textbox [Solved by Rock] thx   (175 Views)
!!olleh:DI have a problem with asp.net, I want enabling and disabling a textbox when the user select the option this are enabled, if not disabled.my problem is when I select some checkboxs this work wrong :Smy code:Code:If CheckBoxList1.SelectedIndex = 0 Then DropDownList1.Enabled = True TextBox6.Visible = True TextBox11.Visible = True ' DropDownList6.Visible = True ElseIf CheckBoxList1.SelectedIndex = 1 Then CheckBoxList1.Items(0).Selected = True DropDownList2.Visible = True TextBox7.Visible = True TextBox12.Visible = True ' DropDownList7.Enabled = True ElseIf CheckBoxList1.SelectedIndex = 2 Then CheckBoxList1.Items(0).Selected = True CheckBoxList1.Items(1).Selected = True DropDownList3.Visible = True TextBox8.Visible = True TextBox13.Visible = True 'DropDownList8.Enabled = True ElseIf CheckBoxList1.SelectedIndex = 3 Then CheckBoxList1.Items(0).Selected = True CheckBoxList1.Items(1).Selected = True CheckBoxList1.Items(2).Selected = True DropDownList4.Visible = True TextBox9.Visible = True TextBox14.Visible = True 'DropDownList9.Enabled = True ElseIf CheckBoxList1.SelectedIndex = 4 Then CheckBoxList1.Items(0).Selected = True CheckBoxList1.Items(1).Selected = True CheckBoxList1.Items(2).Selected = True CheckBoxList1.Items(3).Selected = True DropDownList5.Visible = True TextBox10.Visible = True TextBox15.Visible = True ' DropDownList10.Enabled = True End Ifwhen I select the first is ok. when I select the second dont enabled the control.any ideasthx regards,
disable backspace from dropdown list   (175 Views)
Is there a way to disable backspace, from a dropdown list or another control - i.e., a textbox, from C# client or side either way is ok. , It sounds like this is an ASP.NET application. Is it If it is, you don't want to be going back to the server every time someone pushes a key. We'll move this thread if it is, so you can get more targeted help in the ASP.NET forum. This post has been edited by Curtis Rutland: 06 April 2011 - 07:01 AM , No, this is client side script, so it won't be slow. As LoD said, don't check the body's keydown, check the specific control's keydown.
computer open and software enable and all fuction disabled   (287 Views)
hiiiiiiiiiiii every one. I want to know that how can i create a code in asp.net and c# when we start the computer then my application is opened and all the application of computer is disabled and when we login the application then all the functionality is enabled then we worked on computer. If we logined three times wrong password then the ok button is disabled and the shutdown button is enabled. when we click on shut down button then the system is shutdown. plz help me now emidately
Better way to disable controls?   (133 Views)
Hi , i use the code below to disable all controls i have on a web page. If i add different controls in the future i dont want to have to amend this code every time to include them. Is there a better wsy of doing this foreach (Control ctrl in Page.Controls) { if (ctrl is TextBox) { ((TextBox)(ctrl)).Enabled = false; } if (ctrl is DateTimePicker) { ((DateTimePicker)(ctrl)).Enabled = false; } if (ctrl is PickListControl) { ((PickListControl)(ctrl)).Enabled = false; } if (ctrl is CheckBox) { ((CheckBox)(ctrl)).Enabled = false; } }
popup right click disable   (203 Views)
, i am using the following code to open a popup window in this code can i disable right click on the popup string url = "example"; Response.Write("window.open('" + url + "', '_blank', 'height=500,width=350,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no,align=center' );");
ASP.NET and VB.NET: problem with GridView's "disabled" b   (135 Views)
I have pulled data from SQL Server into a GridView control. Two of the columns are checkbox fields. During run-time,I am to click those columns to enter a check. But how can I find out if the values of those items during run-tim I need to allow the user to indicate whether they approve or deny a request; and then, I shall be able to update the corresponding columns in the originating database table. What must I do to solve this problem During run-time, I added these two columns to the already existing ones: Dim myCol1 As New DataColumn("Approved") Dim myCol2 As New DataColumn("Denied") myCol1.DataType = System.Type.GetType("System.Boolean") myCol2.DataType = System.Type.GetType("System.Boolean") myDataSet.Tables(0).Columns.Add(myCol1... myDataSet.Tables(0).Columns.Add(myCol2... myDataSet.Tables(0).AcceptChanges() I have code in myGridView_RowUpdating(): Try 'For Each column As GridViewRow In myGridView.Rows(myGridView.EditIndex) ' Access the CheckBox 'Dim cb As CheckBox = column.FindControl("Approved") 'Perhaps could also check to see if the index of the row equals myGridView.EditIndex For Each row As GridViewRow In myGridView.Rows ' Access the CheckBox Dim cb As CheckBox = row.FindControl("Approved") If cb IsNot Nothing AndAlso cb.Checked Then Console.WriteLine("Found") 'Here, I want to see if the Approved checkbox is checked. End If Next Catch ex As Exception Console.WriteLine(ex.Message) End Try This is the code that I placed in myGridView_RowCommand(): Static intCount As Integer Dim intRowIndex As Integer 'If intCount = 0 Then intRowIndex = CInt(e.CommandArgument.ToString()) 'dim intColumnIndex as Integer = cint(Request.Form(["__EVENTARGUMENT"]) myGridView.EditIndex = intRowIndex 'Place this particular row of the GridView control in edit mode. intCount += 1 'End If 'If intCount = 0 Dim intResponse As Integer Dim strAnswered As String If (e.CommandName.Equals("Edit")) Then ElseIf (e.CommandName.Equals("Update")) Then Console.WriteLine("Update") ' If myGridView.Rows(intRowIndex).Cells.Item("2").ToString And myGridView.Rows(intRowIndex).Cells.Item("2").Text Then ' End If 'intResponse = MsgBox("Are you sure that you want to approve this request", MsgBoxStyle.YesNoCancel, "Confirmation Required") ElseIf (e.CommandName.Equals("Cancel")) Then Else 'Nada End If 'If (e.CommandName.Equals("Edit")) If intResponse = vbCancel Then MsgBox("The record has not been changed.", MsgBoxStyle.OkOnly, "No Action Taken") Exit Sub End If If intResponse = vbYes Then 'Retreive the value of the key Dim strKey As String 'strKey = myGridView.DataKeys(intRowIndex).Values(0).ToString 'Oops! There has been nothing assigned to DataKeys. 'Note: myGridView.Rows(intRowIndex).Cells.Item(0).Text is "", since it is the column of DELETE buttons. 'This gives the contents of the first row, first column. It would have been Cells.Item(0), had it not been ' displaced by the row of EDIT buttons. strKey = myGridView.Rows(intRowIndex).Cells.Item(1).Text 'Call the handling routine, with strKey as a parameter. 'SupervisorResponse(strKey) End If 'If intResponse = vbYes
Enable and disable treeview based on user login.   (197 Views)
HI,I would like to control treeview based on priority of user, such as administrator and user.eg. if administrator login all the node will be displayed, but during user login specific user only can view specific node, and some of the node will be disable. User credential will keep in database or based on windows login.can anybody give me any link of source code. Kindly give me more links.Below attach some code, for administrator login, administrator manage to see clothing and electronics node.When user login, user only manage to see clothing. How to modify this code KINDLY HELP ME
how to disable close option   (165 Views)
hi, Am working in asp.net with mysql as database.I want to know how to disableclose and mininize option for a certain time interval for a particular window.Please give me the solutions....
How to disable back button in all browsers in asp.net?   (238 Views)
Hi , I'm doing a quiz website.I have "start.aspx" page which is having "start test" button. When i click on that button,the web page will be redirected to "quiz.aspx" page where i'm displaying questions for users.I have totally 10 questions.but i will display one question at a time in my "quiz.aspx" page.The questions will change when user click on the "next" button.So here,When user finished answering first question,he will click on the "next" button to display second question in the same page.At this time,when he click on back button in the browser window, it should not go back. for this i have tried the following code. function disableBackButton() { window.history.forward(); } setTimeout("disableBackButton()", 0); But it's not working in both IE and firefox.. Alternatively also I have tried to remove cache and i wrote Response.CacheControl = "no-cache" but it's working in IE and not in firefox.. I'm spending more time in this back button issue.. plz anyone direct me to do it successfully
ASP.NET and VB.NET: problem with GridView's "disabled" b   (177 Views)
___________________ I have pulled data from SQL Server into a datagrid control. Two of the columns are checkbox fields. But during run-time, I am unable to click either of those columns to enter a check. Are they disabled by default. I need to allow the user to indicate whether they approve or deny a request; and then, I shall be able to update the corresponding columns in the originating database table. What must I do to solve this problem I added these two columns to the existing ones in run-time: ----- Dim myCol1 As New DataColumn("Approved") Dim myCol2 As New DataColumn("Denied") myCol1.DataType = System.Type.GetType("System.Boolean") myCol2.DataType = System.Type.GetType("System.Boolean") myDataSet.Tables(0).Columns.Add(myCol1... myDataSet.Tables(0).Columns.Add(myCol2... myDataSet.Tables(0).AcceptChanges() ----- The datagrid control's Enabled and AutoPostBack properties are set to True. The problem is not with the two columns that I added during run-time, as the same situation occurs when there are checkbox fields that originate from the datasource, and are automatically displayed in the datagrid control. ______________________ This post has been edited by jayman9: 25 February 2008 - 02:09 AM