You haven't included any code, which makes it a bit difficult.  :-)  I'll have a guess 
...

> The initial value of the check box is "OFF".

I assume you mean that you have:

  <input type=checkbox name=xxx value="OFF">

If so, then this isn't the INITIAL value, it's the value.  It stays the same whether 
it's checked or not.  And the user checking the box doesn't change it to "ON".  
(Although you could intercept the checking action in JavaScript and set the value to 
"ON" that way, I'm assuming you haven't done this.)

The value will always be "OFF", but the checkbox will only be visible to ASP if it is 
checked.  ASP will not be able to see the checkbox at all if it is unchecked.

To display a checkbox as initially checked, you need to give it the checked attribute:

  <input type=checkbox name=xxx value="OFF" checked>

If it doesn't have this attribute, it'll be unchecked.

When I'm equating a checkbox with a Boolean value from a database field, I tend to 
implant a call to a little routine to generate this if the database control is True:

  <input type=checkbox name=xxx value="OFF" <%= setChecked (databaseBooleanField) %>>

where my JScript code for the routine is

  function setChecked (control)
  {
    if (control)
      return " checked ";
    else
      return "";
  }

HTH

Dave S
  ----- Original Message ----- 
  From: arnnie 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, May 25, 2004 4:11 AM
  Subject: [ASP] Reading a checkbox value on asn ASP form!


  Dear friend:

  I have a form with several checkboxes.  I am able to get the check 
  box value before submitting the form and storing it in a database.   
  Later, when I load a form and put check box value back to the check 
  box from the database I cannot get the form to show the correct check 
  box state.  For example: The initial value of the check box 
  is "OFF".  I have the check box not checked.  When the form is loaded 
  the user check the box.   These actions change the check value 
  from "OFF" to "ON".  The form is submitted.  Then later another form 
  is loaded with the values previously assigned (the values are stored 
  in the database).  However, the check boxes state does not change 
  from not checked to checked.  Can someone assist me this?






  ---------------------------------------------------------------------    
  Home       : http://groups.yahoo.com/group/active-server-pages
  ---------------------------------------------------------------------
  Post       : [EMAIL PROTECTED]
  Subscribe  : [EMAIL PROTECTED]
  Unsubscribe: [EMAIL PROTECTED]
  --------------------------------------------------------------------- 


        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/
      
    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/17folB/TM
---------------------------------------------------------------------~->

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to