Results 1 to 2 of 2

Thread: Check Box problem!

  1. #1

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Thumbs up

    Hi there!
    If I use a checkbox in a asp page, displaying the value from the database and updating the value of the checkbox to the database seems to be a problem. At present I am using another hidden input to pass the value. I hope someother easy method may be there!
    Can u help me?
    Thanx in advance!
    J£ßä

  2. #2
    Guest
    Code:
    <html>
      <head>
        <title>Checkbox Test</title>
      </head>
      <body>
        
        <p>
        <%
          if request("chkTest") = "on" then
            Response.Write "Checkbox is checked.<br>Write ""true"" to database."
          else
            Response.Write "Checkbox is not checked.<br>Write ""false"" to database."
          end if
        %>
        </p>
          
        <form action="<%=Request.ServerVariables("SCRIPT_NAME") %>" method="post">
          
          
          <label for="test"><input type="checkbox" name="chkTest" <% if request("chkTest") = "on" then Response.Write "checked" %> id="test"> Text</label><br>
          <input type="submit" value="Test it!">
        </form>
        
      </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width