Making a Text Field Required if User Checks box

Hi,
I am currently using Adobe Designer 7.0, and am trying to make a text field required if a user clicks on a check box above the text field.
I have the following code for the check box (on Change) but it doesn't appear to be working!! Any suggestions??
Thanks!
if (this.rawValue == 1 ){
TextField7.value = "User Entered - Required";
else {
TextField7.value = "User Entered - Optional";

Hi Krisitan,
you are trying to change the value of the field instead of it's accessability.
Try this:
if (this.rawValue == 1 ){
TextField7.mandatory = "error";
else {
TextField7.mandatory = "disabled";

Similar Messages

  • Making a text field required when a radio button is clicked

    Hello all, I am very new to designing PDF forms, and I want to implement this requirement but have no idea how to go about doing it. I am designing an order form, and in a few different sections of the form are text fields that I want to be required, but only if a certain radio button on the form is clicked. So for example, I have a radio button group on the page consisting of two buttons, and then immediately to the right is a text field. If the user selects button 1, the text field is not required, but if they select button two, the text field is required. How do I implement this? I am using Livecycle ES3. And when I say required, I am referring to the field value/property of "User Entered - Required". Also, I cannot accomplish this by hiding and unhiding the field depending on which button is clicked, as this form will also be printed and filled out by hand, so all fields must be visible at all times. This form does have a submit by e-mail button and that is how it will be used primarily.
    Also, I have searched around the forums a bit, and have tried some Javascript I have found, tying it to a mouseup event on the radio button, for example "getField("Text1").required = (getField("Radio1").value == "Yes");" and "getField("Text1").required = true;" with the names changed for my fields, but no matter what I try it has no effect
    Thanks!

    i hope this helps u.You can always optimize tht code a bit more , it's coded roughly but it works.
    <html>
    <head>
    <script>
    var cursel='r1';
    function radioClick(x)
         if(cursel!=x)
              cursel=x;
         if(cursel=='r2')
              var z=document.getElementById('mydiv');
              mydiv.innerHTML='<input type=text name=ss size=20/>';
              mydiv.style.display='inline';
         else
              var z=document.getElementById('mydiv');
              mydiv.innerHTML='';
              mydiv.style.display='inline';
    </script>
    </head>
    <body>
    <form>
    <input type=radio name=rtt onClick="radioClick('r1');" checked />Radio 1
    <br>
    <input type=radio name=rtt  onClick="radioClick('r2');"/>Radio 2
    <br>
    <div id=mydiv></div>
    </form>
    </body>
    </html>

  • SPEL? make REASON field required if user has changed the value in SALARY

    I have a requirement to make REASON field required if user has changed the value in SALARY field. Is it possible using spel? what are my options?

    Karan,
    You can change the Rendered Property through personalization.
    But in your requirement you need to attach the Spell through personalization & extend the existing CO to set the value of the SPELL based upon the condition.
    Note - Refer this thread http://forums.oracle.com/forums/thread.jspa?threadID=2176729&tstart=0. If you have worked on SSHRParams kindly help the user.
    Regards,
    Gyan

  • I/O field grayed out after check box checked ( Dynpro)

    Hi ,
    I have dynpro  dialog screen  with several check boxes linked with input/output field
    When check box is checked the I/O field is editable when check box is empty I/O field should be grayed out.
    I am trying to find the way how checking the check box can trigger the change of attribute of I/O field.
    The IO field should be gray out after checking check box without hitting enter or any other button.
    Please advice
    Chris

    Hi ,
    Thank you for your answer. I was missing Functional code of my check boxes.
    Now i have still issue my I/O field do not turns in gray ( only output) In loop
    I dide like you said ( this is example from my PAI module user-command)
    when 'CB1'.
          loop at screen .
            if screen-name = 'LT_FORMAT_IO'
              and lt_format_cb is initial.
              screen-input = '0'.
              screen-invisible = '1'.
              modify screen.
            endif.
          endloop..
    Once screen is displayed again , the IO field stll remains non grayed out.
    Please advice
    Chris

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

  • If a checkbox is selected how to make a text field required

    Hi
    I hoping someone out there can help me.
    I am creating a form in adobe acrobat 9, I have a checkbox called 'other' and a text field named 'other_please_specify'. What I am hoping to do is when a user selects the 'other' checkbox the 'other_please_specify' text field becomes required. I will also need some sort of action that if a user deselects the 'other' checkbox then the 'other_please_specify' text field is no longer mandatory.
    Can anyone help me figure this out?
    Thanks in advance

    If by required you mean the required property of the field, the Mouse Up script of the check box can be something like:
    (function () {
        // Get a reference to the text field
        var f = getField("other_please_specify");
        // Set the required property depending on the check box state
        if (event.target.value !== "Off") {
            f.required = true;
        } else {
            f.required = false;
    The "if" block can be simplified to:
        // Set the required property depending on the check box state
        f.required = event.target.value !== "Off";

  • Making the comments field Required in the Workitem

    Hello,
    I have a GP Application wherein the initiator fills out a form which goes to the Approver using Visual Approval Callable Object.........now when the approver opens the workitem he sees the information entered by the initiator and a comments field at the bottom......we want to make this field required for them.......how can we achieve this.....while creation of the Visual Approval Callable Object i see the comments as a output parameter with the 'Is Required' checkbox option....but it is disabled and does not allow you to select it......Please help...
    Any help would be highly appreciated...
    Regards,
    Anil

    Hi Anil,
    Standard Visual Approval CO doesnt work like that.
    Either you can create your own CO.
    OR
    i can suggest you as follows, but it is making little complicated process.
    1. Create one Action with Business Logic callable object, which will check for Comment EQ space or not and have 2 different states.
    a. If Comments is blank, Go back to Approval Action
    b. If Comments is entered, Proceed for further actions.
    2. Set this action as target for Approval Action.
    Hope this helps you.
    Thanks,
    Tejaswini

  • Making "Business Place" field Required in MIRO

    Dear fellow SAPers,
    Can anyone please tell me how to maintain the status of  "Business Place" field in MIRO as Required? The client wants to ensure that this field is populated everytime MIRO is done, irrespective of the user.
    Please Help,
    Thanks,
    Amit Bharti

    Hi,
    To make the business place field required for MIRO, you can write the validation as below:-
    Step 1:-
    Create a message ID via transaction code SE91 for message class /EACC/MSG/ACC_COMP.
    Step 2:-
    Go to transaction GGB0 and create the validation step at line item level in Financial Accounting as below:-
    Pre Requisits:-
          BKPF-TCODE = 'MIRO' AND BSEG-BLART = 'K'.
    Check:-
          BSEG-BUPLA = ' '.
    Message:-
         Message created in step 1 as error message.
    Step 3:-
    Please also check that this validation has active status (Status=1) at line item level for your company code in transaction OB28.
    Regards,
    Gaurav

  • Text field required on PO

    Dear All,
    i want to have one new text field on item level in PO so that i can update some text for ma future requierment.
    in STD system i dunt have any field which covers my requirement.
    PLease guide
    Thanks

    Hi,
    Please check in SPRO
    SPRO - MM- Purchase order - Texts for purchase orders
    (or) take the help of SAP ABAP persons to add a new field
    Regards
    G.Ganesh Kumar

  • Making short text field in Display mode for one particular Purchasing

    Hi All,
    This is regarding Making the Short text field in Display mode of PR for one Particular Purchasing.. i am giving you a bit elaborate...We are into E-Catalog Procurement.I will do the shopping from the Vendors external catalog and i will return back to SAP.
    While doing so, i dont want the user to change the Short Text field. I want that field shud display the Description. When i tried with the Screen Layout settings, it is fully grayed out and i am not able to see the Description of the Material. Is there any other options to get this enabled?. Please advice me on this settings to be done. Thanks in Advance.
    With Regards,
    Saakithyan

    Hi
    Define a Field selection key (new not the one which is assigned to document type) which makes  short text editable in screen layout config. and assign it to functional authorization value in t.code OMET. (it should be numeric). Then assign that functional authorization value in user master SU01 for users with parameter id EFB.
    Then it will work
    Regards
    Antony

  • Making a form field required when another field is selected

    I have a contact form with the usual fields required (name, address, city, etc.). I'm adding a Country pull-down list to the form, which will default to the US being selected. Since a "State" field is not relevant for anyone filling out the form from another country, I'd like to make the State field required only if the country selected is United States, and not required for any other country. Is there a way to do this?
    Thanks,
    R-Co

    What you need is to be able to create a required textfield when the first textfield shows USA and destroy the required field when another country is selected.
    The following may help to understand create and destroy
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Deleting and rebuilding validations</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextFiel d.css" rel="stylesheet">
    </head>
    <body>
    <form id="form1" method="post" action="#">
      <p>
        <input type="radio" name="radio" id="Married" value="Married" onclick="val(this);">
        <label for="Married">Married</label>
      </p>
      <p>
        <input type="radio" name="radio" id="Defacto" value="Defacto" onclick="val(this);">
        <label for="Defacto">Defacto</label>
      </p>
      <p>
        <input type="radio" name="radio" id="Single" value="Single" onclick="val(this);">
        <label for="radio">Single</label>
      </p>
      <hr>
      <span id="sprytextfield1">
        <label for="f_married">Married</label>
        <input name="married" id="f_married" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <span id="sprytextfield2">
        <label for="f_defacto">Defacto</label>
        <input name="defacto" id="f_defacto" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <span id="sprytextfield3">
        <label for="f_single">Single</label>
        <input name="single" id="f_single" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <hr>
      <input type="submit" value="Submit" />
    </form>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationTextField.js"></script>
    <script>
    var sprytextfield1,
            sprytextfield2,
            sprytextfield3;
    // build validations and delete / destroy them
    function val(e){
        // get the value
        value = e.value;
        // see what radion button we have
        if(value == "Married"){
            // if there inst a validaton build one
            if(!sprytextfield1){
                sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
            // if there is a validaiton in sprytextfield destory it, and clear the variable
            if(sprytextfield2 && sprytextfield2.destroy){
                sprytextfield2.resetClasses();
                sprytextfield2.destroy();
                sprytextfield2 = null;
            // same as the rest
            if(sprytextfield3 && sprytextfield3.destroy){
                sprytextfield3.resetClasses();
                sprytextfield3.destroy();
                sprytextfield3 = null;
        } else if(value == 'Defacto'){
            if(!sprytextfield2){
                sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
            if(sprytextfield1 && sprytextfield1.destroy){
                sprytextfield1.resetClasses();
                sprytextfield1.destroy();
                sprytextfield1 = null;
            if(sprytextfield3 && sprytextfield3.destroy){
                sprytextfield3.resetClasses();
                sprytextfield3.destroy();
                sprytextfield3 = null;
        } else if(value == 'Single'){
            if(!sprytextfield3){
                sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
            if(sprytextfield1 && sprytextfield1.destroy){
                sprytextfield1.resetClasses();
                sprytextfield1.destroy();
                sprytextfield1 = null;
            if(sprytextfield2 && sprytextfield2.destroy){
                sprytextfield2.resetClasses();
                sprytextfield2.destroy();
                sprytextfield2 = null;
        // proceed with the rest as normal
        return true;
    </script>
    </body>
    </html>

  • F110-Text field requirement

    Hello Experts,
    While making payment to the vendor through F110, we need text field to enter text for our reference but standard SAP has not provided text filed for the payment documents through Automatic payment run.
    Please let us know through ABAP coding will it be possible to bring text field in F110 run?
    Thanks for your valuable suggestions.
    Thanks,
    Ratnam

    Dear,
    As we know, such kind of option is not available,
    If the text is same for all the payment documents, you can do a mass change through
    FBL1N - Execute, select the documents, Menu bar -> Environment -> Mass change -> New values
    Else, better to convince your Client and made the program to ZF110 and get the filed into change made.
    Long term perspective this is better
    Thanks

  • How can I format a field to have a Check Box in the center.

    I am a new adobe user and I am creating a form in Adobe LiveCycle Designer. Most of what I needed to do I was able to figure out, but I cannot find a way to place a Check Box in the center of a chosen field. Each time I use the Check Box from the library it automatically places the Box in the center-right of the field. Then when trying to format the paragraph, I get no options about where I'd like the box to reside within the field. Is there a simple way to get a Check Box into the center of a Field or will I have to pursue other options. If I do have to pursue other options are there any ways to limit a text to an X and have it either be On or Off?
    Thanks for your aid.

    This behaviors usually happens when you create the fields but  a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field  "company name" printed in each and every page of a multi-page form document.
    Go to the properties fields of each field and make sure  to assign unique form field  names.

  • How to Auto-populate TextField in Acrobat x with a value determined by user check box selection?

    I have a group of 3 Check Boxes for user to select their Work Shift:  The check boxes are set up to be mutually exclusive (same name: "EMP_Shift", different Export Values: Day, Evening, Night).
    Form Field properties name:      EMP_Shift (for all 3 check boxes)
    Acrobat edit panel field names:  EMP_Shift#0, EMPShift#1, EMPShift#2
    Export Values:                         Day, Evening, Night (chose these only because they are descriptive)
    I need to Auto-populate a Text Field named EMP_WorkShift with "Day" if EMP_Shift#0 is selected, "Evening" if EMPShift#1 is selected, or "Night" if EMPShift#2 is selected.
    Is there a script I can use to accomplish this in Acrobat Pro X.

    The simplest is to set up the text field to be calculated using the following custom Calculate script:
    // Get the value of the check box
    var v = getField("EMP_Shift").value;
    // Set this field value
    event.value = v !== "Off" ? v : "";
    You'd normally set the text field to be read-only, but if you want the user to be able to edit the text field, you can instead use the following script in the Mouse Up event of each check box:
    // Get the value of the check box
    var v = event.target.value;
    // Set the value of the text field
    getField("EMP_Workshift").value = v !== "Off" ? v : "";

  • Grey out the input field as soon as check box checks on selection screen!

    HI Experts,
    In my report selection screen I have input_field1, input_field2, check_box1. Both input fields are mandatory fileds.
    My requireemnt is: If user as soon as checks the check_box1, the first input_field1 must go grey out (not allow allow to enter)!
    So I have assigned a user command to check box and assigned a modif-ID to the input_field1
    and wrote a LOOP AT SCREEN code as below,
    PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p1 TYPE c LENGTH 10,
                p2 TYPE c LENGTH 10,
                p3 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS: p4 TYPE c LENGTH 10 MODIF ID bl2,
                p5 TYPE c LENGTH 10 MODIF ID bl2,
                p6 TYPE c LENGTH 10 MODIF ID bl2.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF show_all <> 'X' AND
           screen-group1 = 'BL2'.
           screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    But,am getting an error message saying "Enter all required fields"
    Pls. let me know how to fix this?
    Thank you

    I assume P1, P2 and P3 are marked as obligatory.
    You cannot achieve that. But here is an alternative to achieve a similar functionality.
    AT SELECTION-SCREEN.
      CHECK sy-ucomm EQ 'ONLI' OR sy-ucomm = 'SJOB' OR sy-ucomm = 'PRIN'.
      IF p1 is INITIAL or P2 is INITIAL or P3 is INITIAL.
        MESSAGE 'Enter all required fields' TYPE 'E'.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF show_all = 'X' AND
           screen-group1 = 'BL2'.
          screen-input = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.

Maybe you are looking for