# Really simple (probably) checkbox question

**URL:** <https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345>\
**Category:** Uncategorized\
**Created:** [April 20, 2006, 5:23pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345 "2006-04-20T17:23:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 20, 2006, 5:23pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345/1 "2006-04-20T17:23:27Z")

</div>

Okay well I know nothing about html programming but somehow got stuck with building our branch’s internet site and implementing a few projet log type cold fusion database things.

So I built a form with a bunch of checkboxes. User goes to form, checks a bunch of boxes, submits. This works great.

User wants to edit what they’ve checked so they click on “edit”. This goes to a new form though it looks the same so they can’t tell. What I want to know is, how can I get it to show the boxes they checked the first time? Right now I’m just recreating the input boxes so I don’t know how to tell it to get the information already submitted and show that (e.g. “if it was checked before check it now”).

I don’t know \*\*any \*\*javascript so if you recommend some code please explain it and where it goes!

thanks :hr:

---

<div class="post-metadata">

**Author:** ![955](https://avatars.discourse-cdn.com/v4/letter/9/4bbf92/32.png) [@955](https://forum.kirupa.com/u/955)\
**Post date:** [April 20, 2006, 5:52pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345/2 "2006-04-20T17:52:02Z")

</div>

Look ma, no JavaScript!

```auto
<input type="checkbox" checked="checked" name="mycb" />

```

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 20, 2006, 6:02pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345/3 "2006-04-20T18:02:22Z")

</div>

Well all that does is automatically check the box. What I need to know is if it was checked before then check it now otherwise leave it blank. 🙂

Actually I figured it out. I had already done it in another place and forgot I had done that but once I found it I realized what an idiot I am. Simply use a query from the database and then insert a \<cfif\> statement into the input type so it looks like this:

```auto
<input type="checkbox" name="mycheckbox" <cfif #myquery.checkboxItem# is 1>checked</cfif>>

```

Works beautifully!

---

<div class="post-metadata">

**Author:** ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)\
**Post date:** [April 20, 2006, 6:27pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345/4 "2006-04-20T18:27:16Z")

</div>

That’s ColdFusion? 😮 Looks a lot like ASP.

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 20, 2006, 6:36pm UTC](https://forum.kirupa.com/t/really-simple-probably-checkbox-question/186345/5 "2006-04-20T18:36:22Z")

</div>

well, the cfif tag inside the html is coldfusion . . .  
it’s a cold fusion if statement as opposed to some other language if statement, like they’ve got some kind of ownership on an if function :sure:  
unfortunately i know very little of programming - just a bit of html, actionscript, and coldfusion (and all based on the one year of C++ I had in school). Enough to get me in trouble and make me look dumb by asking simple questions. 😛
