Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Determine a CheckBox Name?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Determine a CheckBox Name?

 Post Reply Post Reply
Author
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post Topic: Determine a CheckBox Name?
    Posted: 03 February 2004 at 4:52pm

I have a page that contains many individual checkboxes, each checkbox is associated with a seat and has a distinct name based on row and seat number (ie checkbox id = "t14" for seat 14 in row t).  I need to be able to set a checkbox's visible flag = False if the seat is already taken, and I am having some difficulty with it.  The seats are not aligned since seating is not necissarily straight, it can be a circle or arc, so I do not want to create a subroutine to generate the checkboxes on the fly, I would rather generate all the checkboxes, then run a subroutine that would set the corresponding flags to non-visible if they are taken.

I can find all of the checkbox controls on a form, but I cannot compare them to a specific name, so I cannot change their values.  Let's say I have a list of 3 seats taken {r12,r13,r14}... how can I create a subroutine that will set the checkbox flag for r12,r13,r14 = false?

Any help or points in the right direction would be helpful.  Thanks!

Back to Top
Leeb65 View Drop Down
Groupie
Groupie


Joined: 05 December 2003
Location: Germany
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote Leeb65 Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2004 at 2:34am

Can you show us some code you have already written?

Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2004 at 8:31am

I have a sql statement that returns to me a list of all of the seats already taken.  I combine the seat row and seat number to create a seatid, which is the same name as the checkbox i.e.

Sub get_Rows
...
  'Open db get recordset
  Row = RS("sRow")
  Num = RS("sNum")
  ID = Row + Num 'ID = 'Q14' for example
  'Get next record
...
End Sub


I have a series of checkboxes in the body of the page:
<body>
....
' Row Q
<asp:CheckBox id="Q12" style="Z-INDEX: 101; LEFT: 120px; POSITION: absolute; TOP: 420px"
runat="server" Text=" " BorderColor="Transparent" BackColor="Transparent" ForeColor="Transparent"></asp:CheckBox>
<asp:CheckBox id="Q13" style="Z-INDEX: 118; LEFT: 676px; POSITION: absolute; TOP: 346px"
runat="server" Text=" " BorderColor="Transparent" BackColor="Transparent" ForeColor="Transparent"></asp:CheckBox>
<asp:CheckBox id="Q14" style="Z-INDEX: 117; LEFT: 659px; POSITION: absolute; TOP: 341px"
runat="server" Text=" " BorderColor="Transparent" BackColor="Transparent" ForeColor="Transparent"></asp:CheckBox>
<asp:CheckBox id="Q15" style="Z-INDEX: 115; LEFT: 643px; POSITION: absolute; TOP: 336px"
runat="server" Text=" " BorderColor="Transparent" BackColor="Transparent" ForeColor="Transparent"></asp:CheckBox>
<asp:CheckBox id="Q16" style="Z-INDEX: 114; LEFT: 626px; POSITION: absolute; TOP: 331px"
runat="server" Text=" " BorderColor="Transparent" BackColor="Transparent" ForeColor="Transparent"></asp:CheckBox>
....

As you can see they are not in any geometric pattern, they are matched to a specific layout of a room and how seats are aligned.  What I need to be able to do in the sub is once I have 'Q14' set the visible flag = false for the checkbox with id='Q14'.

Any ideas?

 

Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2004 at 9:48am

Nevermind, I figured it out. =)

Dim ct2 as new Checkbox()
ct2 = ctl ' where ctl = a checkbox
if ct2.id="Q14" Then
  ct2.visible = False
End if

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.