473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

clicking checkboxes in a view using checkbox present in another view of a multiview

hi,

i am having an apllication which has a multiview if i check one checkbox in a view other checkboxin another view should get checked . i am using server side script
and getting it but for immediate results we need to put Autopostback=true for those checkboxes.But i want to use javascripts for this operation can we use it. plese help me in this regard .if possible send me a sample code.


thanks and regards
vijay
Aug 30 '07 #1
4 1833
phvfl
173 Expert 100+
Hi Vijay,

You would be able to this, you could also remove the autopost back once it was enabled. You would use the onclick() event on the checkbox and in the function that is called set the checked property.

In the function called you would load the checkboxes that were being changed into objects, possibly using the document.getElementById('id') function, and then do
Expand|Select|Wrap|Line Numbers
  1. checkbox.checked=true;
  2.  
One possible issue that comes to mind is that if the checkboxes are asp:checkbox not HTML input elements then the ID may be an ASP generated on depending on the position in the DOM. If this is the case let me know and I can work through this with you.

Let me know if you need more info on this, sorry to be vague but I can't really provide any examples without knowing what your code is like.
Aug 30 '07 #2
thanks for ur support.i am already using javascript for this purpose but for both checkboxes belonging to one view of a multiview.


in C#(code file) page load
Expand|Select|Wrap|Line Numbers
  1. checkbox1.atrributes.add("onclick","javascript:click1()");

in javascript file


Expand|Select|Wrap|Line Numbers
  1. function click1()
  2. {
  3. if(document.getelementbyid("checkbox1").checked==true
  4. {
  5. document.getelementbyid("checkbox2").checked=true;
  6. }
  7. else
  8. {
  9. document.getelementbyid("checkbox2").checked=false;
  10. }
  11. }
  12.  
for checking another checkbox2 using checkbox1,but this is only valid for checkboxes within a view of multiview but not between checkboxes of belonging to different views of a multiview,as only one view is active a time.please help me in this regard.


with regards

vijay
Aug 31 '07 #3
acoder
16,027 Expert Mod 8TB
Please use CODE tags when posting code. Thanks!

Javascript is case-sensitive. Use document.getElementById(id) - note the E, B and I.
Sep 1 '07 #4
phvfl
173 Expert 100+
How does the multiview update when going from one view to another? Is this a postback update or a style change to hide on view and show another?

If the HTML for the multiple views is on the page then you should be able to update the checked status through javascript.

Could you also check the ID that is generated in the HTML for the checkboxes, .NET will often change the ID from what is defined in the aspx source file if there is nesting within controls to ensure that IDs stay unique.
Sep 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wendy S | last post by:
I have this working, but I don't think it's done efficiently or the best way: <a href="javascript:setAllAccounts(true)">check all</a> <a href="javascript:setAllAccounts(false)">clear all</a> ...
5
by: Deborah V. Gardner | last post by:
I would like to use "Yes" and "No" checkboxes on a subform. The problem is that when I click the Yes checkbox on the subform, all of the checkboxes are checked. Currently, I have a field...
2
by: Alexander van Doormalen | last post by:
I have a MultiView control with 2 Views in it. In the first View I have a form which contains sereral input controls and a custom UserControl. In this custom UserControl I have a button which...
10
by: rn5a | last post by:
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....
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
1
by: Nathan Sokalski | last post by:
When I include a MultiView control in my application, I receive the following error: MultiView cannot have children of type 'Label'. It can only have children of type View. I receive the...
5
by: sasimca007 | last post by:
Hi friends, I have a doubt about checkboxes, i.e if i am creating checkboxes with the same name, in a loop and i have another checkbox down to the above checkboxes, My problem is...
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the...
3
by: Patrick | last post by:
Hi, Newbish on JS here. Found this script on the web and it does what I want in FF, but works oddly in IE. When I check the box in IE nothing happens, but when I click on the body after the box...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.