Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript anyone?.

Participant ,
Oct 13, 2006 Oct 13, 2006
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")' %> />
TOPICS
Server side applications
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Oct 18, 2006 Oct 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"/>
Translate
LEGEND ,
Oct 13, 2006 Oct 13, 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")' %> />
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 16, 2006
Sorry for my stuprid questions but where should i remove the"" and where should i input the "(". Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 16, 2006 Oct 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.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 16, 2006
I tried the code by ace but im still getting this error message.

Microsoft JScript compilation error '800a03ec'

Expected ';'

/systems/lvcc/January/January.asp, line 169

if (value='R') then response.write "(disabled=disabled)"
------------------------^
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 16, 2006 Oct 16, 2006
This is ASP/JScript? Or ASP/VBScript?

--
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:eh0g73$ij6$1@forums.macromedia.com...
>I tried the code by ace but im still getting this error message.
>
> Microsoft JScript compilation error '800a03ec'
>
> Expected ';'
>
> /systems/lvcc/January/January.asp, line 169
>
> if (value='R') then response.write "(disabled=disabled)"
> ------------------------^
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 16, 2006
it is asp/jscript
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 16, 2006 Oct 16, 2006
ASP/VBScript or ASP/JScript? Show me the 1st three lines of your page's
code, please.

--
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:eh0im9$lok$1@forums.macromedia.com...
> it is asp


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 16, 2006
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../../../Connections/lvcc.asp" -->
<%
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 16, 2006 Oct 16, 2006
OK - you are using ASP/Javascript. Can I ask why?

Anyhow, I can't help you with that. Sorry.

ASP/VBScript is the usual choice....

--
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:eh0qas$1r8$1@forums.macromedia.com...
> <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
> <!--#include file="../../../Connections/lvcc.asp" -->
> <%


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 16, 2006 Oct 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2006 Oct 16, 2006
not really i call my code crap code. I know just a little.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 18, 2006 Oct 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"/>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 18, 2006 Oct 18, 2006
LATEST
Hopefully that works great for you, and glad that you got it all sorted.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines