2 Replies - 4002 Views - Last Post: 09 August 2012 - 10:26 PM

#1 hotpink797   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-August 12

Problem getting check box to stay checked

Posted 09 August 2012 - 02:39 PM

Ok so ive been working on creating a site and ran into a few problems when i started inserting check-boxes. The code ive been using works fine for the base check box but the problem is that i wanted to be able to check the box and have it remain checked (even if i switch pages or refresh my page) until i uncheck the box and for it then to stay unchecked until i again re-check it. The current code ive been using is -
<form name="myWebForm" action="mailto:[email protected]" method="post">
</p><input type="checkbox" name="sports" value="basketball" />

</form> 

someone had told me to insert
< input type="checkbox" checked="true"/>
into my current code but i either inserted it wrong or it doesn't work. I had inserted just the
checked="true"/>
part after the existing
< input type="checkbox"
part in the original code. I was looking for help on either where to insert the add on part of the code i have above or if there is something else i can add to my code to make it do what i want.
Thank You,
Lauren

Is This A Good Question/Topic? 0
  • +

Replies To: Problem getting check box to stay checked

#2 exiles.prx   User is offline

  • D.I.C Head

Reputation: 65
  • View blog
  • Posts: 241
  • Joined: 22-November 10

Re: Problem getting check box to stay checked

Posted 09 August 2012 - 05:17 PM

Sounds to me like you are placing the value checked="true" in the wrong location. Can you post you entire code with checked code you added included.

EDIT: hmm....seems as though I was told wrong as well by my HTML instructor, and to be wrong about something so simple... irritating.

This post has been edited by exiles.prx: 10 August 2012 - 09:53 AM

Was This Post Helpful? 0
  • +
  • -

#3 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4278
  • View blog
  • Posts: 13,573
  • Joined: 08-June 10

Re: Problem getting check box to stay checked

Posted 09 August 2012 - 10:26 PM

View Posthotpink797, on 09 August 2012 - 11:39 PM, said:

someone had told me to insert
< input type="checkbox" checked="true"/>
into my current code but i either inserted it wrong or it doesn't work.

then someone told you wrong. itís
<input type="checkbox" checked>

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1