Skip to main content
Inspiring
October 13, 2006
Answered

Javascript anyone?.

  • October 13, 2006
  • 4 replies
  • 1015 views
Im trying to disable a checkbox if the data in the accsess database = r . This is what i have.
<input name="2ND" type="checkbox" value="R" <% if(value='r') then response.write'disabled="disabled")' %> />
This topic has been closed for replies.
Correct answer lands1ide
I figured it out here is the code if anyone needs it
<input <%=(((Recordset2.Fields.Item("Jan1").Value) == "R" || Recordset2.Fields.Item("Jan1").Value == "A" || Recordset2.Fields.Item("Jan1").Value == "2")?"checked=\"checked\"":"")%>name="1ST" type="checkbox" id="1ST" value="R"/>

4 replies

Deaf_Web_Designer
Inspiring
October 19, 2006
Hopefully that works great for you, and glad that you got it all sorted.
lands1ideAuthorCorrect answer
Inspiring
October 18, 2006
I figured it out here is the code if anyone needs it
<input <%=(((Recordset2.Fields.Item("Jan1").Value) == "R" || Recordset2.Fields.Item("Jan1").Value == "A" || Recordset2.Fields.Item("Jan1").Value == "2")?"checked=\"checked\"":"")%>name="1ST" type="checkbox" id="1ST" value="R"/>
Deaf_Web_Designer
Inspiring
October 16, 2006
Lands1ide,

Are you fluent in coding or working with database apps, no? Murray or myself or other could recommend you a book or two, but we might want to know if you are talented coder working with database apps.
lands1ideAuthor
Inspiring
October 16, 2006
not really i call my code crap code. I know just a little.
Inspiring
October 14, 2006
You're missing a "(" and you have an extra "'".

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"lands1ide" <webforumsuser@macromedia.com> wrote in message
news:egp70k$6nt$1@forums.macromedia.com...
> Im trying to disable a checkbox if the data in the accsess database = r .
> This
> is what i have.
> <input name="2ND" type="checkbox" value="R" <% if(value='r') then
> response.write'disabled="disabled")' %> />
>


Inspiring
October 16, 2006
<input name="2ND" type="checkbox" value="R" <% if(value='r') then
response.write('disabled="disabled"') %> />

HOWEVER, your test "if(value='r')" is supposed to be testing WHAT?


--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"lands1ide" <webforumsuser@macromedia.com> wrote in message
news:eh09d6$a7u$1@forums.macromedia.com...
> Sorry for my stuprid questions but where should i remove the"" and where
> should i input the "(". Thanks.


lands1ideAuthor
Inspiring
October 16, 2006
This is what i am utimatly trying to achive. A little background. The page i am creating is to request Vacation. I am using an update record method. origionaly all boxes will be blank when they request leave. when they hit submit it inputs a r into the database. We go into the database and change the r's to a's or d's based on if it is approved. If they want to request additional leave. they pull up the same page. I wanted it to prevent employees from checking or unchecking a box that they have already been approved or denied for. I am trying to keep each employee to only one record since the insert record make duplicates and is hard to sort through. Is there a way to hide a checkbox if there is data already in the accsess database for that field. I am using .asp