Professional Web Applications Themes

checkbox - ASP

I know there is a way to update records with a checkbox. Is there a way to update this records (with different value)by unchecking the checkbox?...

Sponsored Links
  1. #1

    Default checkbox

    I know there is a way to update records with a checkbox.
    Is there a way to update this records (with different value)by
    unchecking the checkbox?
    Sponsored Links
    wildt Guest

  2. #2

    Default Re: checkbox

    I have the submit selected chechbox working.

    SQL = "UPDATE emp SET attended='Active' WHERE ID
    IN("&request.form("toadd")&")"

    I'm trying to use uncheck to update the attended field
    when the checkbox is unchecked.

    if it was previously selected the checkbox is checked.

    This is what i have to uncheck and it's not doing anything
    If Request.form("toadd") = "" then
    SQL = "UPDATE CourseReg SET attended='' WHERE ID
    IN("&request.form("toadd")&")"


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    tom wilfred Guest

  3. #3

    Default checkbox

    I know this is gonna sound silly but when I submit a form with a checkbox
    html control "mychk", how can I see if that is checked or not ?

    I have tried :

    if request.form("mychk") = true then
    ' code
    else
    ' code
    end if

    But it always executes the code in the else statement meaning it is never
    true despite the fact I have given the checkbox a value of true.




    Paul Guest

  4. #4

    Default Re: checkbox

    Try if request.form("mychk") = "true" then

    The checkbox is a string not a boolean value.




    "Paul" <paulthemedialounge.com> wrote in message
    news:%23FK6fURTDHA.2148TK2MSFTNGP11.phx.gbl...
    > I know this is gonna sound silly but when I submit a form with a checkbox
    > html control "mychk", how can I see if that is checked or not ?
    >
    > I have tried :
    >
    > if request.form("mychk") = true then
    > ' code
    > else
    > ' code
    > end if
    >
    > But it always executes the code in the else statement meaning it is never
    > true despite the fact I have given the checkbox a value of true.
    >
    >
    >
    >

    MDB Guest

  5. #5

    Default checkbox

    i have only 1 checkbox.. if user not check that box then he/she can not go to
    the next field
    my coding
    <TD><INPUT name="Agree" type="checkbox" value="YES" <cfif Agree is
    "YES">checked</cfif>> Yes, I accepted it &nbsp;</Td>
    <cfif Agree is unchecked {
    window .alert(" Please check an agrreement box");
    return false;
    }
    it does not work .... Please help

    torm Guest

  6. #6

    Default Re: checkbox

    I'm assuming that you have a form, with a checkbox on it, and if they don't
    check the checkbox, they either can't submit the form or can't enter data in
    fields below the checkbox.

    What you're wanting is a client-side process. Coldfusion is server-side,
    meaning that the user's browser doesn't see any coldfusion code, all the
    coldfusion commands are already processed by the time the response gets back to
    the user.

    Javascript is one client-side technology that will work in this instance. If
    you want to prevent them from submitting a form unless they check the box,
    you'll need something like:
    <script language="javascript">
    function checkAgreement() {
    if(!doent.myform.Agree.checked) {
    window.alert("Please check an agreement box");
    return false;
    }
    return true;
    }
    </script>
    <form name="myform" method="post" action="processForm.cfm" onSubmit="return
    checkAgreement();">
    <input type="checkbox" name="Agree" value="Yes"> Yes, I accepted it<br>
    <input type="submit" value="Submit" name="Submit">
    </form>


    Kronin555 Guest

  7. #7

    Default Re: checkbox

    Hi
    i am lucky to see you again ... hihhihii good fridat huh..????? thanks alot i
    t works ... and i feel y i am stupid..
    i think i need to learn more javascript... i worked witrh window before.. i
    did not take any
    HTML or JAVASCRIPT ... I learn HTML by myself and got trainning 1 class
    coldfusion ... Could you tell me where
    i can get more information a about JAVASCRIPT....??? can iT stand alone
    ...??? or it just works like
    function.. thanks SO MUCH adn very very much.



    torm Guest

  8. #8

    Default Re: checkbox

    I like the O'Reilly books. Here's one on Javascript:
    [url]http://www.amazon.com/exec/obidos/tg/detail/-/0596000480/qid=1117551971/sr=8-1/ref=pd_csp_1/104-4188798-1333552?v=glance&s=books&n=507846[/url]
    Kronin555 Guest

  9. #9

    Default checkbox

    hi , i´m new in the world of vb.net. I´m using sql server, vb.net
    language: my problem is : i have a table "Test" with "Text and Sure"
    as row. "Sure" is a bit value. how do i insert "Sure" in the database
    with the insert command in vb.net?
    Here is the insert command
    objSQL ="Insert into Aufträge (AuftragsDatum, Name, Vorname,
    StrassePostfach, PLZ, Ort, Telefon," & _
    "Bearbeiter, Garantie, ExterneNummer, RechnungsDatum, Auftraggeber,
    Tätigkeit, Arbeitsfeld1, Arbeitsfeld2, Arbeitsfeld3," & _
    "Angebot, Auftrag, BVName, BVStrasse, BVPLZ, BVOrt, Auftragsumme,
    Schlussrechnung, Text) Values (AuftragsDatum, Name, Vorname,
    StrassePostfach, " & _
    "PLZ, Ort, Telefon, Bearbeiter, Garantie, ExterneNummer,
    RechnungsDatum, Auftraggeber, Tätigkeit, Arbeitsfeld1, " & _
    "Arbeitsfeld2, Arbeitsfeld3, Angebot, Auftrag, BVName, BVStrasse,

    BVPLZ, BVOrt, Auftragsumme, Schlussrechnung, Text)"
    Dim objConn As SqlConnection = New
    SqlConnection(ConfigurationSettings.AppSettings("S toeve"))
    Dim objCmd as New SQLCommand(objSQL, objConn)

    objCmd.Parameters.Add(New SQLParameter("AuftragsDatum",
    "txtAuftragsDatum.Text"))
    objCmd.Parameters.Add(New SQLParameter("Name",
    "txtName.Text"))
    objCmd.Parameters.Add(New SQLParameter("Vorname",
    "txtVorname.Text"))
    objCmd.Parameters.Add(New SQLParameter("StrassePostfach",
    "txtStrassePostfach.Text"))
    objCmd.Parameters.Add(New SQLParameter("PLZ", "txtPLZ.Text"))
    objCmd.Parameters.Add(New SQLParameter("Ort", "txtOrt.Text"))
    objCmd.Parameters.Add(New SQLParameter("Telefon",
    "txtTelefon.Text"))
    objCmd.Parameters.Add(New SQLParameter("Bearbeiter",
    ddlMA.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Garantie",
    SqlDbType.Bit,1
    "Garantie"))
    SqlParameter paramGarantie = New SQLParameter("Garantie",
    SqlDbType.Bit,1,"Garantie")
    paramGarantie.Value=CBG.Checked
    objCmd.Parameters.Add(paramGarantie)
    objCmd.Parameters.Add(New SQLParameter("ExterneNummer",
    "txtExterneNummer.Text"))
    objCmd.Parameters.Add(New SQLParameter("RechnungsDatum",
    SqlDbType.DateTime,8, "RechnungsDatum"))
    objCmd.Parameters.Add(New SQLParameter("Auftraggeber",
    ddlAG.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Tätigkeit",
    ddlT.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Arbeitsfeld1",
    ddlA1.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Arbeitsfeld2",
    ddlA2.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Arbeitsfeld3",
    ddlA3.SelectedItem.Value))
    objCmd.Parameters.Add(New SQLParameter("Angebot",
    SqlDbType.Bit,1,
    "Angebot"))
    objCmd.Parameters.Add(New SQLParameter("Auftrag",
    SqlDbType.Bit,1,
    "Auftrag"))
    objCmd.Parameters.Add(New SQLParameter("BVName",
    "txtBVName.Text"))
    objCmd.Parameters.Add(New SQLParameter("BVStrasse",
    "txtBVStrasse.Text"))
    objCmd.Parameters.Add(New SQLParameter("BVPLZ",
    "txtBVPLZ.Text"))
    objCmd.Parameters.Add(New SQLParameter("BVOrt","
    txtBVOrt.Text"))
    objCmd.Parameters.Add(New SQLParameter("Auftragsumme",
    SqlDbType.Money,8, "Auftragsumme"))
    objCmd.Parameters.Add(New SQLParameter("Schlussrechnung",
    SqlDbType.Money,8, "Schlussrechnung"))
    objCmd.Parameters.Add(New SQLParameter("Text",
    "txtText.Text"))
    objConn.Open()
    objCmd.ExecuteNonQuery()
    label1.visible="true"
    BindData()
    objConn.Close()
    label1.text = "Die Datei wurde gespeichert!"
    'Response.Redirect("insertAuftrag.aspx")


    End Sub
    Thanks

    reg Guest

Similar Threads

  1. [PHP] Q: How to get the value of a checkbox of which name without '[]'?
    By Cpt John W. Holmes in forum PHP Development
    Replies: 1
    Last Post: April 12th, 05:27 AM
  2. Replies: 4
    Last Post: June 13th, 02:29 AM
  3. asp checkbox
    By S. Justin Gengo in forum ASP Components
    Replies: 6
    Last Post: July 5th, 07:04 PM
  4. How can I get the checkbox's value
    By Jack in forum ASP
    Replies: 1
    Last Post: October 14th, 05:27 AM
  5. Q: How to get the value of a checkbox of which name without '[]'?
    By Dallas Thunder in forum PHP Development
    Replies: 3
    Last Post: August 18th, 08:42 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139