Hiding text box based on check box checking

Hello,
I have a jsp in which based on whether the check box is checked or unchecked I want to hide or show a text box. I am including the text box in a div tag & calling a javascript function to set the style of the div to hidden or shown based on whether the check box is checked or not. although i am getting the correct values in the alerts the text box is not getting hidden.
   <td class="label"><label for="chk1"><gbms:message key="lblSearchforDeletedCustomer"/>:</label></td><td class="input">
              <html-el:checkbox property="chk1" value="N" tabindex="3" onclick="javascript:checkboxClicked(document.forms['formCustomerOrVehicleMaintenance'])" onfocus="fnShowError(document.formCustomerOrVehicleMaintenance.chk1);"></html-el:checkbox> <gbms:message key="chek"/> 
                             </td>
                             <div id="delDateDiv" style:hidden>
                        <td class="label"><label for="txtDeleteDate"><gbms:message key="lblDeletedAsOf"/>:</label></td><td class="input">
             <html-el:text property="txtDeleteDate" size="6" maxlength="40" tabindex="3" onchange="fnChanged()" onfocus="fnShowError(document.formCustomerVehicleMaintenanceDelete.txtDeleteDate);"></html-el:text> <a href="#" onclick="cal1xx.select(document.forms[0].txtDeleteDate,'anchor1xx','MMddyy'); return false;" name="anchor1xx"><img src="<%=request.getContextPath()%>/css/common/calendar.gif" border="0" style="cursor: hand"></a><gbms:help jsp="customerVehicleMaintenanceDelete" module="admin" languageCode="<%=request.getLocale().getLanguage()%>" field="DeletedAsOf"/>
                    </td></div>javascript function being called..
function checkboxClicked(aThis)
                    var aform = document.forms['formCustomerOrVehicleMaintenance'];
                    var aDiv = document.getElementById('delDateDiv');
                    alert(aDiv.style.visibility);
                    alert(aDiv.innerHTML);
                    alert(aform.chk1.checked);
                    if(aThis.chk1.value == true)
                         aform.txtDeleteDate.value = '';
                         aform.txtDeleteDate.disabled = false;
                         aDiv.style.visibility = 'visible';
                    else
                         aform.txtDeleteDate.value = '';
                         aform.txtDeleteDate.disabled = true;
                         aDiv.style.visibility = 'hidden';
               }

in my javascript function the value returned is true when checkbox is checked & false when it is unchecked. visibility is also giving correct value in the alert. but still field is not hiding
          function checkboxClicked()
                    var aform = document.forms['formCustomerOrVehicleMaintenance'];
                    var aDiv = document.getElementById('delDateDiv');
                    alert(aDiv.style.visibility);
                    alert(aform.chk1.checked);
                    if(aform.chk1.checked)
                         aform.txtDeleteDate.value = '';
                         aform.txtDeleteDate.disabled = false;
                         aDiv.style.visibility = 'visible';
                         alert("inside if");
                         alert(aDiv.style.visibility);
                    else
                         aform.txtDeleteDate.value = '';
                         aform.txtDeleteDate.disabled = true;
                         aDiv.style.visibility = 'hidden';
                         alert("inside else");
                         alert(aDiv.style.visibility);
               }

Similar Messages

  • Populate drop-down lists based on check box selections

    Hi. I'm creating a Service Work Order form. At the top, there are several check boxes for the various services we provide, under that , more text fields, drop downs and checkboxes to elaborate on those services, and then at the bottom, fields for pricing.
    I'd like the top half of the form to drive the pricing info that is available or that auto-populates at the bottom.
    Ideally, I'd like to make the pricing specific based on 3 things:
    the service checkbox
    the client
    and the details on that service
    For example:
    If Client XYZ wants Service A that includes subservice B
    $123 should show up on the bottom half in the field for that service
    If Client ABC wants Service B that includes subservice C
    $456 should show up on the bottom half in the field for that service
    Does that make sense?
    I've been unable to get code to work in either the calculate and pre-Open options
    I first tried calculate and used this code (which was just a guess on my part)
    if (CheckBox1 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox2 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox5 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 55
    elseif
    (CheckBox6 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 55
    elseif
    (CheckBox7 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox8 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    else
    $.rawValue = 0
    endif
    That didn't do anything but give me an error about "and"
    So I tried putting code in pre-Open:
    // clear the dropdown displayed value and items
    this.rawValue = null;
    this.clearItems();
    // repopulate the items based on the checkboxes
    if(offshore.rawValue == 1)
        this.addItem("$40.00", "offshore_001");
        this.addItem("$45.00", "offshore_002");
        this.addItem("$50.00", "offshore_003");
    if(inland.rawValue == 1)
        this.addItem("$40.00", "inland_001");
        this.addItem("$45.00", "inland_002");
        this.addItem("$50.00", "inland_003");
    I got no error but nothing populated and the drop-down was, in effect, disabled.
    Any help would be appreciated.
    Thanks!

    Gavin,
    This sounds like an issue that is not related to JHeadstart. To simplify the test case, you could create a simple drag-and-drop ADF application without JHeadstart and see if the same problem occurs there.
    Your suggestion that it is related to the where clause seems likely. Please find out what kind of object USER_ENV is, and how it is initialized. Maybe this initialization is skipped when bouncing the application.
    What happens if you perform the query in SQL*Plus, without doing anything about the USER_ENV?
    Maybe you should ask the Oracle Applications discussion forum...
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • How do I auto populate a text box if a check box is ticked in Acrobat XI Pro?

    Basically, i have been asked to create a catalogue of sorts for my organisation with a form at the end that will be completed by the end user. it will be a catalogue of books and toys that people can request to borrow from us. Its all specialist equipment that we loan out for disabled people. When they are scrolling through the catalogue i would like there to be a check box and if they would like to borrow that item they would tick that box and any other products that they would like to borrow. Is it possible to have a text box that auto populates with a list of the items they have selected. the form would be similar to the one below. it the box next to Products to borrow i would like it to add products as they tick the boxes in the preceeding pages. I would be happy to share an example document if needed. thanks in advance for any help.
    Name
    Address
    Products to borrow

    Thank you for your willingness to help.
    The problem with a drop down is that it would not present all options when printed, and some of our users will be completing this form manually (printed). All options need to be displayed.
    Here's an example:
    SELECT PREFIX:
    A12
    B12
    C12
    They can check one of the above and then based on what they select, I want the next box (a text field) to pre-fill with their selection.
    So if they select A12, the text box would automatically fill with A12.

  • Outputting check box input to text box

    I have another javascript question regarding Acrobat.
    I have an order form with 3 categories of check box sets.
    Set 1
    a
    b
    c
    d
    Set 2
    e
    f
    g
    h
    Set 3
    i
    j
    Each checkbox outputs the SKU of an item which in this case is insignificant.
    Here are the scenarios available to the user.
    Option 1 - One option from Set 1 AND one option from Set 2 must be selected. (Which i have working just fine)
       OR
    Option 2 - One option from Set 3 must be selected.
    These are the only possible options.
    I have a text box set to read only as the total box. It totals up the cost based on the options they select.
    If they select option 1 it needs to output $285 to the total box
    If they select option 2 it needs to output $475 to the total box.
    My theory is that I need to make an if then statement but I don't understand how to write the code for this to work.
    Any one's expertise would be extremely helpful.
    Thanks

    Are these fields independent from one another, or is each set a group of fields with the same name but different export values?

  • Check box selection based on name inside a field

    I have a fillable PDF form
    the form has 2 check box selections.  M  or F   (male or female)
    i can get a field to populate with M or F or Male or Female but how can I get a check box to select M or F based on
    what comes into a field ?

    You can use the text-field's custom validation script to edit the check-box, for example:
    if (event.value=="Male") this.getField("CheckBoxMale").checkThisBox(0, true);
    else if (event.value=="Female") this.getField("CheckBoxFemale").checkThisBox(0, true);

  • Need to change the LOV field based on checked box selection in OAF page

    Dear ALL,
    I have a requirement as below:
    I have a custom OAF page having a lov  field which is mandatory, a check box and a two text fields.
    So based on LOV value selection i am defaulting two text field value automatically.
    So my requirement is when user selects the check box automatically the LOV field should be non mandatory and user can insert in values to the lov field and text field and submit it.
    SO basically based on check box field selection i need to make the lov field in such a way it should accept all the values what user enters instead of check the query added in VO behind the LOV.
    Please suggest me some pointers to achieve this requirement.
    Thanks
    Deb

    hi,
    in PFR use:
    if ("checkevent".equals(pageContext.getParameter(EVENT_PARAM))) 
                     HashMap hashMap = new HashMap();
                     String checkboxval=pageContext.getParameter("item2");
                  hashMap.put("checkboxval",checkboxval);
                    pageContext.setForwardURLToCurrentPage(hashMap ,
                    true, // retain the AM
                    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
                    OAWebBeanConstants.IGNORE_MESSAGES);
    and in PR use:
    if((pageContext.getParameter("checkboxval'))!=null)
    OAMessageLovInputBean lovInputBean=(OAMessageLovInputBean)webBean.findIndexedChildRecursive("item3");
          lovInputBean.setRequired("false");
    try it
    Regards
    Mahesh

  • Is there a way to auto check a check box triggered off the completion of a specific text box?

    I am using Conga Composer. I'm hoping when information is filled into a specific text box in a pdf, it will auto check a specific checkbox.  Any script ideas? Or if this is even possible? I've seen scenarios for the reverse, but my situation requires this particular flow.

    I highly doubt this process is going to trigger any of these scripts, if that's what you're planning...
    What you can do add a doc-level script that will execute when the file is opened and set the check-box based on the text field's value, in addition to the custom keystroke code. That would look something like this:
    this.getField("CheckBox").checkThisBox(0, this.getField("TextBox").value!="");

  • Access 2010 - If Then Else Statement to display text within text box upon Check Box True/False condition

    I have a form called myForm. On this form is a check box called myCheckBox. I also have a text box labeled myTextBox. I have assigned a macro, myMacro, to run upon selection/click of myCheckBox. The macro is an If statement which determines if myCheckBox
    is checked or not checked and spits out a value, "Yes" or "No" for example, into the text box.
    I am not able to get text to display into the text box although I am not receiving any errors when I run the macro. This may be a fault in my logic and would like help resolving where the problem lies. I am fairly new to Access so this could be something
    simple.
    My code is as follows:
    If Forms!myForm =  True Then
      Forms!myForm!myTextBox.Value = "Yes!"
    ElseIf Forms!myForm = False Then
      Forms!myForm!myTextBox.Value = "No!"
    Else
      Forms!myForm!myTextBox.Value = " / ERROR / " 
    End if
    Thanks!

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, the issue is more related to coding/programing, you'd better post your question to the MSDN forum for Access
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=accessdev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • How do  we check the check box items based on the databse fields.

    Hi All,
    I have a requirement like as mentioned below#
    1. I have a combox box whcih i will be populated from database.
    2. I have created two check box as "Stategric " and "Non Stategric".
    3. Now when i select the combox box condition i need to select the check box items.
    4. But the problem is i wil be knowing weather it is a stategric or Non stategirc based on the database column.
    5. How do i need to map the database point of view and correlacte with javascript pont of view.
    6. Do we need to write any Application process to achieve this task and who we can do that.
    Thanks,
    Anoo..

    Hi VC,
    As per my understanding the code should be placed between --.
    Based on this i have placed the code
    function setCheckbox(pThis, pItem){
    alert('inside');
        var l_code = '';
        // Get checkbox name
        rName = document.getElementsById('P1_ENG_BAU').firstChild.name;
    alert("The value is"+rName);
        // Fire AJAX
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=CHECKBOX_LIST',0);
        get.add('F120_COMPANY',pThis.value);
        gReturn = get.get('XML');
        if (gReturn) {
          var values = gReturn.getElementsByTagName('value');
          var messages = gReturn.getElementsByTagName('message');
          // Build the checkbox
          for (i=0; i<values.length; i++) {
            var rValue = values.firstChild.nodeValue;
    var rMessage = messages[i].firstChild.nodeValue;
    l_code+='<input id='+P1_ENG_BAU+'_'+i+' type=checkbox value='+rValue+' name='+rName+'>';
    l_code+='<label for='+P1_ENG_BAU+'_'+i+'>'+rMessage+'</label>
    document.getElementsById('P1_ENG_BAU').innerHTML = l_code;
    Correct me if iam understanding is wrong.
    Thanks,
    Anoo..
    Edited by: Anoo on May 31, 2012 11:04 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Multiple checked boxes fill in common text field

    I am attempting to create a form that has various criteria that are checked off (check boxes) and need to populate a common text field within the same form. Presently with action items I am able to design the form so that when only one item is checked it shows up on in the text field at a time not multiples  Any suggestions would help.
    Thank you

    1) In the Binding tab of your checkboxes you can put the On Value to whatever you want to populate the common text field with and the Off Value blank.
    2) Assuming all your check boxes names are CheckBox under the same subform use this script in the calculate event of your common text field:
    var aChkList=[];
    var vChecks = CheckBox.all;
    for (var a=0;a<vChecks.length;a++){
    if (!vChecks.item(a).isNull){
      aChkList.push(vChecks.item(a).rawValue);
    this.rawValue=aChkList.join(", ");
    Kyle

  • Need Help: I need a check box to auto fill a set value in separate text field.

    Hi, this is my first time with inserting scripts into a PDF Form.
    We have a form that requires the user to check a box regarding medical conditions they have (i.e. Asthma, Diabetes, Hypertension).  Later in the form, they have to type out the same condition into a text box. (I know stupid to double document, but it is required).  Is there a script that will auto fill the text box when they check the box?  For example, if they check asthma, the text box on a later page in the PDF will say "Asthma, controlled."  Is this possible?
    In addition, if they don't click Asthma, and do click Diabetes, could it add Diabetes to the first text box, but if they check both, it would add Asthma to box 1 and Diabetes to box 2?
    Any help would be GREATLY appreciated.
    I'm using Acrobat 9
    Thanks!

    Hi, I'm staring at the code trying to make it work for my needs, which are similar to Austin's.
    I have a 16-page form with 2,988 checkboxes in the entire document (a little over 200 in each page besides the first and last page). The last page contains a textbox labled Summary, and it should provide a summary of all the items checked in the document. Theoretically only one page will be populated at a time, so there will be no more than 200 checkboxes checked in the entire document.
    Is it possible to use the same code? And do I just put the code under the text in the script that reads:
    form1.SummaryPage.SummaryText::calculate - (JavaScript, client)
    The JS I am trying to get to work is the following from a post above.
    // Custom Calculate script
    (function () {
        var i, v, s = "";
        // Loop through the 2988 check boxes
        for (i = 1; i < 2989; i += 1) {
            // Get the value of the current checkbox
            v = getField("checkbox " + i).valueAsString;
            // Concatenate check box value to string if not deselected
            if (v !== "Off") s+= v + "\r";
        // Set this field value
        event.value = s;

  • How to create a group/list of check box variables for display in text field, in appended format

    I need to identify a series of single-response checkbox variables and display the ones selected (as a group) in a text field in an appended (comma, space) format. Last week, you provided a great little script for a similar need using List Box (multiple response) variables. This time I need to know how to formally identify the checkbox variables and, I presume, use a similar script to display the results in a comma, space format.
    You've been of great help.
    Thanks

    Here's the script adapted to this situation. It assumes there are ten check boxes named cb1, cb1, cb2, ...cb10.
    // Custom Calculate script for text field
    (function () {
        // Initialize the string
        var v, s = "";
        // Loop through the check boxes to build up a string
        for (var i = 1; i < 11; i++) {
            // Get the value of the current check box
            v = getField("cb" + i).value;
            if (v !== "Off") {
                if (s) s += ", ";  // Add a comma and a space if needed
                s += v;  // Add the selected value
        // Set this field value to the string
        event.value = s;
    You'll have to change the field name and starting/ending numbers to match your form.

  • How to implement Check box in the Rtf based on the value from XML datafield

    Hello All ,
    It would be great if any one can help me in implementing check box in the rtf based on the data filed value from the XML data.
    I need to get in the out put checked boxes like what we say Radio button Yes or No ( If Yes it should be marked ).
    If any one worked on this please help us...
    Thanks in Advance...

    Did you check the user guide,
    we have a section over there :)
    http://blogs.oracle.com/xmlpublisher/2007/05/22

  • How to check the "check box" based on an event on form

    Hi,
    I have couple of text items and a check-box on a form. Is there a way I can check the box automatically when the text item values are edited/enterd by user ?
    I'm using the JS shown below but it doesn't work.
    I have this JS in page header.
    +<script type="text/javascript">+
    +function checkTheBox() {+
    document.getElementById('MY_KBOXNAME').checked='checked';
    +}+
    +</script>+
    And I have this in my form element options.
    onChange=checkTheBox();
    What am I doing wrong?
    Thanks in advance,
    Asha

    Hi,
    For checkbox with name P1_CHECKBOX , first checkbox is refferred using P1_CHECKBOX_0 , second one using P1_CHECKBOX_1 and so on..
    Change document.getElementById('MY_KBOXNAME').checked='checked' . instead of MY_KBOXNAME , use MY_KBOXNAME_0, MY_KBOXNAME_1 ETC depending which checkbox you want to check.
    Regards,
    SK

  • How do you send an email to a specific person based on if a particular check box is checked?

    How do you send an email to a specific person based on if a particular check box is checked?

    Try the LiveCycle Designer forum.

Maybe you are looking for

  • Payment for Absence Days in Off Cycle

    Hi, If an employee is to be absent during future payroll periods, for example, because of leave, you can pay the employee in advance for the period of the absence. The remuneration is calculated using Absence Valuation in Off Cycle Payroll. I facing

  • Parser error in ABAP mapping

    Hi ,   i am using the following ABAP mapping program method if_mapping~execute . data: t_edidc type table of edi_dc40, ls_edidc type edi_dc40, ls_edidc_h type edi_dc40, t_edidd type table of edi_dd40, ls_edidd_h type edi_dd40, ls_idx_xmb type idx_xmb

  • I have not been able to import my photos from Adobe Revel into my new Elements 13.  How do I do this?

    Howw do I import my photos from Adobe Revel to Elements 13?

  • How do I get back Flash Player after it got zapped from my system

    I am using  Mac PPC G-5  osX.5.8 Leopard.  Trying to get back my flash player that I uninstalled by accident and can't get the download from Adobe to work.  I went into the archive and downloaded 10.1.102.64 and notice it also downloads a 9. somethin

  • Auto GR/GI in cross company sales

    Our client is already using cross company sales. viz. Company1 creates customer order, creates delivery with shipping point of manufacturing company code (company2). Company1 makes bill on customer, Company2 makes bill on company1. (Typical scenario