Reading checked state of checkbox

Hi there:-
'Sorry to post such a simple question but I can find the
answer in the Dreamweaver online reference, and I have wasted a lot
of time trying to find the answer.
I want to read the checked state of a given checkbox and then
if value of true is returned invoke function "A" or if false is
returned invoke function "B".
Based on what I found in the reference I set up a variable to
capture the state of the checkbox as follows:
function checkboxState()
var checkState = document.all.nameOfCheckbox.checked;
if (checkState == true)
statements
else
if (checkState == false)
statements
The check box is setup as follows:
<input name="nameOfCheckbox" type="checkbox"
onClick="checkboxState()">
This doesn't work and I don't know why. I wondered if I had
to define the checkbox in a particular way, e.g. using the value
attribute or something, but the reference did not indicate this.
If anyone can help I would appreciate it.
Thanks!

Hi Jules,
Thanks for the tip. It worked. I have seen people set up an
if statement without any argument "if(checkStatus)" but I don't
entirely understand the mechanics of what this is doing. (That is,
how a true or false is passed to the variable) But I originally
learned to code COBOL so maybe I am too old fashioned.
Thanks,
Linda

Similar Messages

  • How can i set a form to read only when a checkbox it checked?

    How can i set a form to read only when a checkbox it checked?

    Hi,
    If you search the forums for Paul's example LockAllFields. This contains a function in a script object that you can call from the click event of the checkbox.
    Re: Saving Fillable Form as non-fillable PDF
    Good luck,
    Niall
    Assure Dynamics

  • How do I change appearance states for checkboxes in InDesign CS6?

    Hello,
    I am creating an interactive fillable PDF form and need to use a custom checkbox.
    I am aware as to how I add my 'Icon' to the Sample Buttons and Form Box, but am having difficulty when attempting to alter the appearance states 'Normal' or 'Rollover' or 'Click'.
    It seems that when I turn my button into a checkbox, as soon as it becomes selected, it puts a god awful default tick inside it as opposed to allowing me to choose my own 'Normal' state.
    Please help.
    M/

    I am having the same problem as Mykel. Using CS6, I've created a form and added checkboxes. I had a request that I customize the checkboxes to make them easier to see when checked. I adjusted the states of the checkbox and they seemed to function well....but only in Acrobat Pro X. When I open the PDF in Acrobat Reader XI, then the checkboxes act strangely. (Most of the end users will be using Acrobat Reader, so this is a concern.) When intially checked, they appear in the modified way that I want them to. However, as soon as the user clicks somewhere else on the page, the modified checkbox reverts to the default checkbox with a tick mark in it instead.
    I'm exporting the PDF as an interactive PDF and have tried various settings. I've also experimented with creating a checkbox from scratch rather than modifying a provided checkbox. All to no avail. I'd welcome any thoughts or suggestions anyone may have. Hoping I've just missed a step in the process!
    Here are links to my original CS6 InDesign document and the PDF:
    https://workspaces.acrobat.com/?d=w15hEhbZV4LmGFdQYL-1pA
    https://workspaces.acrobat.com/?d=5rdmI1K-LG8iFoFC4FTRdA

  • How to check whether a checkbox is checked

    This code:
          if (checkBoxCSharpShown.IsChecked)
            checkBoxCSharpShown.IsChecked = false;
    elicits:
    "Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)"
    How can I check whether the checkBox is checked?
    Delphi ancient/C# newbie

    So why is this so complicated? Why doesn't a check box have a true/false value? The answer is that a checkbox can (optionally and not by default) be a three-state control.
    When ThreeState is true, the checkbox has three states:
    Checked
    Not Checked
    Indeterminate
    They correspond to these tests:
    bool checked = IsChecked.HasValue && IsChecked.Value == true
    bool unchecked = IsChecked.HasValue && IsChecked.Value == false
    bool indeterminate = IsChecked.HasValue == false
    One of the ways a three-state checkbox is used is in a property dialog. If the user selects multiple items (all having some boolean property called 'Active'--for instance), what should the proprety dialog show for that selection if the value of Active is different among the selected items? Should it show True? That wouldn't work, they are not all True, same for False. So instead the property dialog would show Indeterminate, indicating that the collection of Active values is neither True, nor False.
    Now having said all of that I'll refer you to:
    CheckBox.Checked
    This is true or false. If the ThreeState property is True, Checked returns True for True or Indeterminate.

  • How to get the number of hits ("returned rows") in read table statement

    Hi Experts
    I have the statement shown below, which seems not to work as I would like it to. My problem is that I would like to do two different things depending on weather or not a read table statement results in 0 hits or 1 (or more) hits.
        READ TABLE g_ship_item
            WITH KEY
         l_ztknum = DATA_PACKAGE-/bic/ztknum
         BINARY SEARCH.
          IF sy-subrc is initial.
          no hits found
            DATA_PACKAGE-/BIC/ZSTAGEERR = 1.
          ELSE.
          hits where found and we will do something else...
            DATA_PACKAGE-/BIC/ZSTAGEERR = 0.
    Hope someone can help me out of my problem...
    Thanks in advance, regards
    Torben

    Hi,
    As you are using READ statement with Binary search, check whether the internal table g_ship_item is sorted with field /bic/ztknum or not. If it is not sorted then the result of this READ statement is not correct.
    Below is the correct code.
    sort  g_ship_item by /bic/ztknum.
    READ table g_ship_item with key g_ship_item = xxx.
    Thanks,
    Satya

  • Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file bu

    Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file but not working. What is the matter and how can I deal with it?

    I am trying it on Adobe Acrobat Reader 9.2.1. Tried to fix Hex code, and also tried 'edit-preference-trust manager'. I focusing on Adobe registries but still couldn't fix the problem.

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Unable to check the "calendars" checkbox in isync

    I want to Sync my calendars with my razr phone, but when i try to check the calendars checkbox, a dialog box pops up telling me i need to start ical, I click the open ical button, ical opens, but the checkbox still does not check. I click the box again, the same dialog comes up, but ical is already open.
    note: I can sync contacts just fine.
    what do i need to do to fix this?
    thanks!

    Welcome to Apple Discussions.
    You may have lost the appropriate level of permissions required to modify the iSync preferences file, or it may have been corrupted. You can first attempt to fix disk permissions, using the Disk Utility application.
    If that does not correct the issue, navigate to this folder:
    Macintosh HD:Users:<username>:Library:Preferences
    and remove the com.apple.isync.plist file, then relaunch iSync. That should allow you to once again drop down the configuration pane for your device and set the options once again for both contacts and calendars.

  • Not able to Check Delta Enabled Checkbox in Datasource

    Hi,
    I created a Custom Datasource in ECC system which extracts data through Function module.  I activated the Datasource without checking the Delta checkbox.  Only when i created Infopackage in BI, i realized my mistake.  When i try to go back to ECC system, i could see that the Delta Enabled check box is now disabled, i am not able to check it now. 
    Is there any way i can make this datasource to Delta enabled in ECC system now?
    Regards,
    Murali

    yes Murali you need to maintain the delta in RSO2.
    select radio button -timestamp local and enter your field:AEDAT.
    check the upper limit n lower limit with functional team so that you do not miss any delta records.
    Check the below link for more detail
    [Geeric Delta|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33]

  • Use spacebar to check/uncheck a checkbox in a datagrid.

    I have a DataGrid that has checkbox in the first column. The user wants to be able to check/uncheck the checkbox when he selects a row, by mouse or up and down keys, and hits the spacebar. Currently the spacebar functions if the last thing that the use has clicked on is the Checkbox. If the user clicks in the cell where the checkbox in located(not the checkbox itself), the spacebar won't do anything.
    <mx:TabNavigator>
         <mx:VBox>
              <ms:datagrid id="lgGrid" dataProvider="{this.lData}">
                   <mx:columns>
                        <mx:Array>
                             <mx:DataGridColumn dataField="vis" id="dfID" sortable="false">
                                  <mx:itemRenderer>
                                       <mx:Component>
                                            <mx:CheckBox click="data.vis = !data.vis"  paddingLeft="4"/>
                                       </mx:Component>
                                  </mx:itemRenderer>
                              </mx:DataGridColumn>
                              <mx:DataGridColumn dataField="name"/>
                        </mx:Array>
                   </mx:columns>
              </ms:datagrid
       </mx:VBox>
    </mx:TabNavigator>

    Your TableModel has to indicate that the column is editable. Your TableModel also has to implement setValueAt() so that when the user changes the value, it updates the data.
    The table will know to use it's own boolean renderer/editor for that column because it knows what to do when a column returns a Boolean.

  • Need help regarding Dynamic Read Table statement

    Hello
    I know that the syntax for dymanic read table statement is
    READ TABLE  <ITAB> WITH KEY (KEY1) = VALUE1  (KEY2) = VALUE2 .....(KEYN) = VALUEN
    Here is my problem..
    I am dynamically creating an internal table based on parameter table entered by user.
    The key for this table can be determined only at runtime.
    The table entered might have by one field as key field or 10 key fields..
    How can I use the dynamic read in this situation ?
    Thanks for your help in advance,
    Santosh
    Edited by: Santosh Kulkarni on Jan 3, 2010 6:58 AM
    Edited by: Santosh Kulkarni on Jan 3, 2010 7:01 AM

    Hello Santosh,
    please check out the following solution. The program demonstrates how to use the dynamic read statement with three key field conditions. Additional key fields can be added in the same way.
    REPORT z_dynamic_read.
    DATA: gt_itab TYPE REF TO data,
          ge_key_field1 TYPE char30,
          ge_key_field2 TYPE char30,
          ge_key_field3 TYPE char30,
          go_descr_ref TYPE REF TO cl_abap_tabledescr.
    FIELD-SYMBOLS: <gt_itab> TYPE STANDARD TABLE,
                   <gs_key_comp> TYPE abap_keydescr,
                   <gs_result> TYPE ANY.
    PARAMETERS: pa_table TYPE tabname16 DEFAULT 'SPFLI',
                pa_cond1 TYPE string DEFAULT sy-mandt,
                pa_cond2 TYPE string DEFAULT 'LH',
                pa_cond3 TYPE string DEFAULT '0123'.
    START-OF-SELECTION.
    * Create and populate internal table
      CREATE DATA gt_itab TYPE STANDARD TABLE OF (pa_table).
      ASSIGN gt_itab->* TO <gt_itab>.
      SELECT * FROM (pa_table) INTO TABLE <gt_itab>.
    * Get the key components into the fields ge_key_field1, ...
      go_descr_ref ?= cl_abap_typedescr=>describe_by_data_ref( gt_itab ).
      LOOP AT go_descr_ref->key ASSIGNING <gs_key_comp>.
        CASE sy-tabix.
          WHEN 1.
            ge_key_field1 = <gs_key_comp>-name.
          WHEN 2.
            ge_key_field2 = <gs_key_comp>-name.
          WHEN 3.
            ge_key_field3 = <gs_key_comp>-name.
        ENDCASE.
      ENDLOOP.
    * Finally, perform the search
      READ TABLE <gt_itab> ASSIGNING <gs_result>
              WITH KEY (ge_key_field1) = pa_cond1
                       (ge_key_field2) = pa_cond2
                       (ge_key_field3) = pa_cond3.
      IF sy-subrc = 0.
        WRITE / 'Record found.'.
      ELSE.
        WRITE / 'No record found.'.
      ENDIF.
    One note: When an internal table is created dynamically like in my program above, the table key is not the key defined in the DDIC structure -- instead, the default key for the standard table is used (i.e. all non-numeric fields).
    Hope this helps,
    David

  • BT Infinity checker states Brentwood as enabled - ...

    I'm sure I'm not the only frustrated one in this position.
    The online checker states that Brentwood exchange is enabled for infinity (apperantly one of the first in the country).
    However, a check against my phone number states that I cant get Infinity. The max I get is ADSL at 1mbit.
    I know that all cabinets are not active but I can't get any information as to which cabinet I connect to and when that will be enabled for Infinity.
    I can't get any help from the BT customer service dept.
    Any help would be appreciated.

    Hi NotBehondInfinity,
    Thanks for the post and welcome to the forum.  I may be able to find out what is going on here.  I cant make any promises but I will certainly see what I can do.
    Please drop me an email via the 'Contact Us' link in my profile. (click on my name and you will find the link under the "about me" section). Include your BT account details and the link to this thread.
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Help regd to CHECK statement

    Hi SDN's
    I am working on 4.6C version.
    I have an internal table ITAB with Sales Group as one of its field.
    I have Sales Group SO_VKGRP on the selection screen as select-options no intervals.
    Now my problem is if the SO_VKGRP has some entries in the excluding list,then the check statement is failing.
    <b>I know i am wrong at some point. Correct me.</b>
    loop at ITAB.
        IF NOT p_spart IS INITIAL.
          SELECT SINGLE * FROM knvv
                          WHERE kunnr EQ itab-cust_acct AND
                                spart EQ p_spart.
          CHECK sy-subrc EQ 0.
        ENDIF.
        IF knvv-spart = 'H1'.
          IF NOT so_vkgrp[] IS INITIAL.
            CHECK knvv-vkgrp in so_vkgrp.
            " wil this be correct if i have entries in the
            " excluding tab of select options
          ENDIF.
    <Some modifications and validation are done here>
        ENDIF.
    endloop.
    Regards
    Pratyusha

    HI
    CHECK log_exp.
    If the statement CHECK is executed outside a loop and log_exp is incorrect, the statement terminates the current process block. You can specify any logical expression for log_exp.
    The behavior of the runtime environment after exiting the processing block is described under Exiting Processing Blocks.
    SAP recommends to use this procedure with the statement CHECK only inside loops (see CHECK (Loops) ).

  • Skinning check mark in Checkbox

    Hi all, 
                I need to skin the check mark of check box. In short i need to draw the check mark as a curved shape. I have attached a screen shot.
    I need to draw the check mark as what you have seen in the image. Please help me.
    Regards,
    Jayagopal.

    you can do this with fxg in the checked state
    I used this to create a red cross, but you can modify it to make a tick and check your path how it looks in design view
    <s:HGroup  x="-1" y="-1" width="100%" height="100%"
                  horizontalAlign="center" verticalAlign="middle">
    <s:Graphic
       includeIn="checked" width="20" height="20" version="2.0"
      >
    <s:Path data="M3,0 L10,8 17,0 20,3 12,10 20,17 17,20 10,12 3,20 0,17 8,10 0,3Z ">
    <s:fill>
    <s:LinearGradient  rotation="45">
    <s:GradientEntry color="#ff3F66" ratio="0.3"/>
    <s:GradientEntry color="#ffff4A"/>
    </s:LinearGradient>
    </s:fill>
    </s:Path>
    </s:Graphic>
    </s:HGroup>

  • Use previous "Delete from hard disk" checked state?

    Is there any way for the program to use the previous "Also delete selected item(s) from the hard disk" checked state in the file deletion confirmation dialog?  It gets tedious to check it every time I want to delete a file and if I forget to do it I will have an extra file sitting on my hard disk not in my catalog.

    A quick shortcut that I use is to hit the spacebar (checks/unchecks the "delete from
    hard disk" option), then hit the enter key to complete the process.
    Michael

Maybe you are looking for