Required Fields based on field value

I am using Acrobat 9.1 Std. This is what I am trying to accomplish I have four text fields that I want to make required based on the selection of a radio button group.
I have two radio buttons on the form w/ the same name w/ the button value set to Yes for one and No for another. If the radio button w/ value Yes is selected I want to set the four text fields to required. If the radio button value is No the text fields should be optional.
Ive found similar postings for what I am trying to accomplish; however, I havent had any success in getting it to function correctly.

Some more information on what I have tried..For simplicity Im just trying to get one text field to work, then I can repeat the java code for the other text fields.
In acrobat Standard 9.1 I go to Forms Add or Edit Fields from there I select the radio button group (contains two radio buttons) on the left column and select properties. Then on the radio button properties dialog box I select the Actions tab. Set the Trigger for Mouse Up and the Action for Run a JavaScript . I click the Add button and enter the following into the JavaScript editor:
if (this.rawValue == "Yes") {
TextField1.validate.nullTest = "error";
xfa.layout.relayout();
else {
TextField1.validate.nullTest = "disabled";
xfa.layout.relayout();
I then close the JavaScript editor, save the form and re-open to test it. I select the radio button w/ value Yes and click the Submit button and the form goes on to submit. At this point I would expect it to error because I didnt fill in any value for TextField1.
I also tried altering the field tag with the below java:
if (this.rawValue == "Yes") {
TextField1.mandatory = "error";
xfa.layout.relayout();
else {
TextField1.mandatory = "disabled";
xfa.layout.relayout();
This also didnt work. Im not sure if I am using the correct tag or not or why I am unable to get the text field to become required for submission.
Any help would be greatly appreciated.
Thanks,

Similar Messages

  • Change value of another field based on the value of selectOneRadio

    Hello
    I need to display one of two city fields based on the value of a radio group. If the value of the radio group is "Yes", then display the non mandatory city field, if the value is "No", then display mandatory city field. Please can someone help me? The code is below
    <af:subform id="contactForm3" default="true">
                <af:panelForm binding="#{processScope.backing_regDetails.contactPanel3}">
                  <af:selectOneRadio binding="#{processScope.backing_regDetails.radio1}"
                                     labelAndAccessKey="#{MatrixResource['ContactDetails.inBoroughQuestion']}"
                                     layout="horizontal"
                                     valuePassThru="true"
                                     required="true"
                                     onchange="javascript.refresh;" >
                      <f:selectItems value="#{processScope.backing_regDetails.items}" />
                  </af:selectOneRadio>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.SAO']}"
                                binding="#{processScope.backing_regDetails.houseNameText}"                           
                                maximumLength="240"/>
                  <af:inputText required="true"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                maximumLength="240"
                                label="#{MatrixCommon['Label.PAO']}"
                                binding="#{processScope.backing_regDetails.numberStreetText}"/>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                maximumLength="240"
                                labelAndAccessKey="#{MatrixCommon['Label.District']}"
                                binding="#{processScope.backing_regDetails.districtText}"/>
                  <af:inputText maximumLength="60"
                                rendered="#{!backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="true"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                 <af:inputText maximumLength="60"
                                rendered="#{backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="false"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                  <af:inputText maximumLength="60"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.County']}"
                                binding="#{processScope.backing_regDetails.countyText}"/>
                  <af:inputText columns="7"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                labelAndAccessKey="#{MatrixCommon['Label.Postcode']}"
                                binding="#{processScope.backing_regDetails.postcodeText}"/>
                  <af:selectOneChoice onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                      binding="#{processScope.backing_regDetails.countrySelect}"
                                      value="#{processScope.backing_regDetails.enteredAddress.countryId}"
                                      labelAndAccessKey="#{MatrixCommon['Label.Country']}">
                      <f:selectItems value="#{backing_regComponents.countryChoiceList}"/>
                  </af:selectOneChoice>
                  <af:inputHidden value="#{processScope.backing_regDetails.enteredAddress.locationId}"
                                binding="#{processScope.backing_regDetails.locationIdHidden}"
                                id="locationId"/>
                  </af:panelForm>
                  </af:subform>Edited by: aademola on Nov 13, 2008 7:35 AM
    Edited by: aademola on Nov 13, 2008 7:42 AM

    Hi,
    you should be able to apply this example to your 10.1.3 project
    see 4.3.2 of http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_lifecycle.htm#CIAHCFJF
    Frank

  • Hot spot for field based on field value

    Hi,
    Im using ALV list to display report. And I have enable hot spot for that field based on field value. For example, If the field has value " 0 " then hotspot should be enabled for that field. If the field has value " 1 " then it should be displayed as normal field without hotspot.
    Can anyone tell me how to do this?
    Thanks,
    Amal

    Hi Amal
    Do this
    In your final internal table
    add a table type
    gi_cellstyles TYPE lvc_t_styl
    Then (while populating output)
    FORM prepare_edit_output.
    * say your field is 'field'
      DATA : lw_stylerow TYPE lvc_s_styl,
             li_styletab TYPE lvc_t_styl.
      IF gw_output-field = '0'.
        CLEAR lw_stylerow.
        lw_stylerow-fieldname = 'FIELD'.
        lw_stylerow-style     = cl_gui_alv_grid=>mc_style_hotspot.
        APPEND lw_stylerow TO li_styletab.
      ELSEIF gw_output-field = '1'.
        CLEAR lw_stylerow.
        lw_stylerow-fieldname = 'FIELD'.
        lw_stylerow-style     = cl_gui_alv_grid=>mc_style_hotspot_no.
        APPEND lw_stylerow TO li_styletab.
      ENDIF.
      INSERT LINES OF li_styletab INTO TABLE gw_output-gi_cellstyles.
    ENDFORM.
    In your layout building
        gw_layout-stylefname = 'GI_CELLSTYLES'.
    Pushpraj

  • Using JavaScript to auto populate a field based on numeric value of a separate drop down field

    Hello, I am trying to set up a simple, I hope, javascript which will enable to me auto populate one field based on the numberic value of another field using Acrobat Pro XI.
    Essentially I have 2 drop down fields (we'll call them DD1 and DD2).
    DD1 is the sum of 8 preceding drop down values. That sum can be anywhere from 0 - 40. Whatever that sum falls within a range which identifies a rating. The ratings and ranges are below:
    0-8: Non-Performer  
    9-16: Low Performer  
    17-24: Performer  
    25-32: High Performer  
    33-40: Exceptional Performer
    DD2 is where the rating ("non-performer", "low performer", etc.) will be captured. Instead of requiring the user to look at DD1, determine the value, and then identify and input the rating manually, I would like DD2 to auto populate the rating based on the value (sum) in DD1.
    For example, if DD1 shows a value of 27 then DD2 would auto populate "High Performer". So how do I write this code or execute this? In excel I would use an if, then statement. Is there something similar in Acrobat Pro XI.
    Any help is greatly appreciated. Thank you in advance.

    If you use a text field, the custom calculation script could be:
    // Custom calculation script for text field
    (function () {
        var s = getField("DD1").valueAsString;
        // Blank this field if input is blank
        if (!s) {
            event.value = "";
            return;
        // Convert string to number
        var v = +s;
        // Set this field's value based on the input
        if (v <= 40 && v >= 33) {
            event.value = "Exceptional Performer";
            return;
        if (v < 33 && v >= 25) {
            event.value = "High Performer";
            return;
        if (v < 25 && v >= 17) {
            event.value = "Performer";
            return;
        if (v < 17 && v >= 9) {
            event.value = "Low Performer";
            return;
        if (v < 9 && v >= 0) {
            event.value = "Non-Performer";
            return;
        // If none of the above fit, blank this field
        event.value = "";

  • Can we change the data type of a field based on the value of the field

    HI Gurus,
    My Requirement is as below -- Could you please guide me
    in the Printable Adobe form -- for ex - as usual for dates fields in the Object Pallette the object type is a date/time field  and for quantity/currency fields corresponding fields are taken
    now in case the either the date, quantity or currency is initial in place of displaying 0.00 or empty date we need to display N/A (Not Applicable)
    for this I would like to change the data type of the field
    to put it simply --
    we need to change the data type of date field from DATE&TIME to Char type to hold N/A or  Quantity field to Char field to hold N/A
    how can we realize this in SAP adobe forms
    Thanks in Advace
    Ramchander Rao.K

    Hello Ramchander,
         You cannot change the data type of the field at run time in Adobe forms because the type of field you choose at the time of design level is associated with the data type itself.
    If you want to achieve your requirement, then your main idea should be to set the data type as CHARACTER itself while designing the field in the adobe form itself. CHAR field will comfortably hold the value of Calculation/amount field, Currency field, Amount, Date, Time HHMMSS, Unit Accuracy, Currency key, Floating point number, Numeric text, Client, Language and many other data types.
    After designing the field as TEXT field in Adobe form you have two options.
    Option 1:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms.
    Suppose the name of the field is TEXTFIELD1, then write the Javascript code on this field in Initialize event as below.
    if ( this.rawvalue == null )
         this.rawvalue = "N/A";
    If the field is not blank, then it will show the date. Else it will show "N/A".
    Option 2:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms. Do the formatting part in ABAP itself. It will increase the performance. Avoid Javascript as much as possible.
    Suppose you have a DATE variable l_dats of type DATS. Then take another variable l_date of type CHAR. Then write the below ABAP code.
    MOVE l_dats TO l_date.
    IF l_date IS INITIAL.
         l_date = 'N/A'.
    ENDIF.
    Bind the l_date to the TEXT field in the form.
    Even in this case, if the field is not blank, then it will show the date. Else it will show "N/A".
    But I will suggest you to use Option 2 of keeping the AMOUNT, QUANTITY, DATE, TIME fields etc as CHAR or TEXT fields in Adobe form and do the required formatting in ABAP itself.

  • Changing fields based on database values

    Hi all,
    I have one form and two drop -down fields. The fields are Call Type and Sub Call Type and are on the SAME form. I pull data from the Call Type from the database. When the user selects a particular Call Type, I need to go back to the database and pull in values associated with that particular Call Type.
    This is the method, that I am using:-
    1) I first populate the Call Type drop down field by using a Server Side Method to fill in values for the Call Type and calling the database.
    2) I then call a method called as PopulateSubCallType by using the property On Change Invoke for the Call Type field.
    In this method I again call the database and based on the Call Type selected by the user, I pull in the associated Sub Call Types and store them in an array.
    3) I also call the same array to populate the Sub Call Types based on Call Types. But the drop down field for Sub Call Type is not auto-populated based on the values from the array. The array values although pulled up from the database are not shown on the form.
    Can you tell me a way to auto-populate the Sub Call Type from the database based on the Call Type selected by the user but on the SAME form.
    I AM NOT USING JSP's but ONLY ALBPM 6.0 PRESENTATIONS.

    refreshValidValues("someAttribute") is a method that comes with BPM Object presentations.
    This one line in this method will work because it causes the attribute (child in this case) to automatically invoke the method you created for retrieving the valid values of the children of the parent.
    Your server side method that dynamically returns valid values of the children based on the parent selected should be looking something like this:
    for each ...
    select * from child
    where parentOfChild = parentAttribute
    In this example the name of your parent attribute is "parentAttribute" column in the child database table that contains the parent's id is "parentOfChild".
    This causes the list of children to auto populate in the child combo dropdown automatically.
    To summarize - at runtime here is what happens:
    a) since the parent has a dynamic method that populates its valid values, as the presentation initializes the SQL for the valid values of the parent is run.
    b) the parent's combo dropdown is populated with a list of valid values of the parent
    c) the end user selects one of the parent's names from the combo dropdown
    d) this causes the method to fire that has only one line. This one line has the text "refreshValidValues("nameOfTheChildAttributeGoesHere")
    e) since the child has a dynamic method that populates its valid values, when the previous step caused this child attribute to refresh its valid values, the SQL in the method that dynamically retrieves the valid values of the child is run.
    f) the end user clicks the combo dropdown on the child's attribute and sees that the child valid values (based on the parent that was just selected) now appear.
    Dan

  • Can we return a value in two field based on a value select in LOV?

    Hello expert.
    i have a lov attached to a non-bind text field. when i select a value from non bind field lov, a record group of another LOV attached to a database item field generated. both text field are in same block.
    LOV record group query of non-bind field is:
    select cli_desc,cli from ivt_cli_mst
    mapping is done for same lov field.
    as: LOV record group query of database item_field :blk_stg_mst.item_cd is
    select a.item_cd,b.short_desc
    from storg_mst a,item_mst b
    where a.item_cd = b.item_cd
    and substr(a.item_cd,3,2) = :blk_stg_mst.nb_cli_cd(non bind LOV attached field)
    and a.store_cd= :blk_store_mst.store_cd
    order by item_cd
    requirement:
    i want as i select a value from LOV in non_bind field , value display in non_bind field as well as database item_field:
    i.e in :blk_stg_mst.item_cd also.
    please help.
    thanks yash

    hi,
    assign LOV to database item.(as usual setting the lov reuturn column to it). in the when validate item of database field assign value to no db field(something like if :db column is not null then :nondb_col := :dbcolumn).

  • How to hide a field based on the value of a field in a different subform - null check doesn't work!

    I'm using Javascript to set the actions. I need to hide a text field if the value of a field in another sub-form is null.
    - tried checking the value of the other field for null - doesn't work
    - tried setting a variable str2 where I know the value of the other field is available then checking that variable when I initialize the text field - doesn't work
    What am I missing?

    Hi.
    Try this in the originating sub form referring to the text field (X). 
    if (this.rawValue = 1)
              X.presence = "visible";
    else if (this.rawValue = null)
              X.presence = "hidden";

  • Disabling a field based on value of three dff fields

    Hi,
    I am trying to disable a dff field based on the value of three dff LOV fields. User selects the value of these three dff from lov. I am using the below code in processRequest method of the controller but its nt giving me desired result. Kindly help me.
    Code:-
    OAMessageLovInputBean selectedSiteUseDetailDFF1 = (OAMessageLovInputBean)paramOAWebBean.findIndexedChild("SiteUseDetailDFF1");
    OAMessageLovInputBean selectedSiteUseDetailDFF2 = (OAMessageLovInputBean)paramOAWebBean.findIndexedChild("SiteUseDetailDFF2");
    OAMessageLovInputBean selectedSiteUseDetailDFF3 = (OAMessageLovInputBean)paramOAWebBean.findIndexedChild("SiteUseDetailDFF3");
    OAMessageLovInputBean selectedSiteUseDetailDFF4 = (OAMessageLovInputBean)paramOAWebBean.findIndexedChild("SiteUseDetailDFF4"); --want to disable this
    String contextVal = null;
    String lobVal = null;
    String atmVal = null;
    String defVal = "ATM Data Fields";
    String defLobVal = "ATM";
    String defAtmVal = "ENV";
         if (selectedSiteUseDetailDFF1!= null && selectedSiteUseDetailDFF2!= null && selectedSiteUseDetailDFF3!= null)
                        contextVal = selectedSiteUseDetailDFF1.getText(paramOAPageContext);
                        lobVal = selectedSiteUseDetailDFF2.getText(paramOAPageContext);
                        atmVal = selectedSiteUseDetailDFF3.getText(paramOAPageContext);
                   if(contextVal == defVal && lobVal == defLobVal && atmVal == defAtmVal)
                        selectedSiteUseDetailDFF4.setDisabled(true);
    Regards,
    Rajeev

    Rajeev,
    Can you try printing the below value to check whether it's returning the expected value. let me know if its returning the screen value.
    contextVal = selectedSiteUseDetailDFF1.getText(paramOAPageContext);
    lobVal = selectedSiteUseDetailDFF2.getText(paramOAPageContext);
    atmVal = selectedSiteUseDetailDFF3.getText(paramOAPageContext);
    Regards,
    Gyan

  • Populate one text field on a form based on the value in another

    I am new to APEX and building my first application.
    When a user enters a value in one field, I would like to run a SQL command and then display a value in another field based on the value in the first field. For instance, if a user enters a part number in one field, when they tab off of the field, I would like to display the name of the part in the part name field.
    Thanks

    Thanks. That put me on the right track. I used that link to find the link http://htmldb.oracle.com/pls/otn/f?p=11933:11:2890374750690437 and then using the two was able to put together a solution.
    I am down to one last issue. I am able to return the name back from the process and display it with an alert statement. Unfortunately, I am unable to display the value on the form.
    I am doing the following.
    <script language="JavaScript1.1" type="text/javascript">
    function f_getCustomerName(id)
    var v_id = id;
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=getCustomerName',$v('pFlowStepId'));
    get.addParam('x01',$v('P2_CUSTOMER_ID'));
    gReturn = get.get();
    get = null;
    gReturn = (!gReturn)?'null':gReturn;
    /* The below do not work
    $s('P2_CUSTOMER_NAME',gReturn);
    document.getElementById('P2_CUSTOMER_NAME').value = gReturn;
    document.getElementById('P2_CUSTOMER_NAME').value = 'TEST';
    alert(document.getElementById('P2_CUSTOMER_NAME').value );
    alert(gReturn);
    //-->
    </script>
    Process: getCustomerName
    declare
    l_customer_id customer.customer_id%type;
    l_customer_name customer.customer_name%type;
    begin
    l_customer_id := to_number(wwv_flow.g_x01);
    select customer_name
    into l_customer_name
    from customer
    where customer_id = l_customer_id;
    htp.p(l_customer_name);
    end;

  • APEX 4.1 show hide fields based on value of checkbox/radio

    I am trying to successfully hide and show fields based on the value of a clicked checkbox.  I am using a dynamic action, but it isn't working. 
    I followed the sample at Does Oracle Apex 4 enable the following AJAX features? (ie without the dev writing the Javascript) - Stack Overflow
    I even tried a radio button, but it didn't work.  I cannot uncheck the radio button.  What am I doing wrong?  Thank you for any help you can provide.

    Hi,
         create a dynamic action for page load to hide the item which you wanna hide
         now create another dynamic action
         event : Click
         Selection Type : Items
         Items : P1_Check_box(name of the check box item)
         condition : equal to
         value : return value of the check box item (if you click the check box and the return value is 1 then just add 1)
         in true actions
         Action : Show
        Selection Type : Items
         Items : P1_Text_field(name of the field)
         uncheck fire on page load
         create exact opposite false action, that's it.
    Regards,
    Mohan.

  • Populate a field based on a drop down or multiple choice

    Would it be possible to add a feature that allows users to populate a field based on the value of another field?
    I'm trying to setup a form where a technician selects their name from a drop down list, and then have the form populate their e-mail address based on their name. I would prefer to avoid forcing them to type in their e-mail address every single time so that they can get a copy of their form responses when they submit a form.
    Thanks!

    Hi,
    Thank you for your feedback. You can vote fo the calculations feature using this form:
    https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
    Regards,
    Brian

  • Show/Hide JSF field based on SelectOnceChoice using Model Driven List

    Hello All,
    I have a use case where I want to show or hide fields based on values populated in SelectOneChoice. I have View master and View Lookup, master has a field named product which displayed selectiononechoice of product name built using lookup view as accessor. I am storing id of lookup type inside product column. Based on a product name say "abc" I want to hide subsequent fields. Can anyone please tell me how to implement this?
    I am using ADF 11g version 11.1.2.
    Thanks,
    Dipal

    If I understand you correctly, you are trying to show/hide subsequent fields based on the value selected from a selectonechoice?
    Did you try using partial triggers and EL for setting the rendered attribute on subsequent fields and setting autosubmit to true on selectonechoice?
    Kristjan

  • Plot a chart dynamically based on the values selected

    Hi All,
    I have some requirement like this i want to plot a chart . The chart should change dynamically based on target_name and date. What type of UI should I use ? I tried using multiselect or shuttle for choosing the target_name and date picker tool for date once i choose all this the chart should appear. Can I have a custom button called submit so once all the values are entered it plots chart ? Please help me out with our ideas.
    Thanks in Advance

    Hi,
    Using the dependent value sets you can govern the values which can be selected based on a specific value selected in a particular segment. Example if Country name is selected in segment 1 then specific states names as per the country selected can be displayed in segment 2.
    As per the requirement described you want to enable different fields based on the value selected in segment1, currently there is no standard mechanism available to enable/disable fields based on a value and you will have to do an extension/customization to meet this requirement.
    Thanks,
    Sanjay

  • Setting the Link Group Name in  Deep Link based on the value of a column

    Using Jdeveloper 11g, Jheadstart 11g
    Is it possible to override the link group name in deep linking. For example can I conditionally set that field based on the value of the item.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:35 AM
    Edited by: aliegeh on Jul 25, 2010 8:43 AM

    Thanks for the suggestion.
    Here is what I am trying to do:
    I have a table with one visible column that has the following entries:
    1. Create
    2. Modify
    3. Verify
    4. Approve
    5. View
    If the user clicks on row 1 (Create) then the link group name should be "CreateEmployees" to create new employees
    If the user clicks on row 3 (Verify) then the link group name should be "MaintainEmployees" for verification and so on.
    (This is role based and each role will have access to one or more of the rows in the tabler)
    It basically mimics a work-flow type of scenario.
    I tried to modify the template and looked at the line:
    action="$JHS.facesConfigGenerator.addItemGroupLinkTaskFlowCall((${JHS.Current.item})}" but got stuck there.
    Is there a way to change "JSH.current.item" in the template to read the group link name from another column say by using #if statements.
    One way I also tried was to introduce a column for each action such as CreateAction, VerifyAction etc which kind of agrees with your suggestion but the drawback is the need to modify the table if another task is required.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:36 AM
    Edited by: aliegeh on Jul 25, 2010 8:42 AM

Maybe you are looking for

  • How can I add loops in GarageBand from my ipad.

    I have purchased an app known GarageBand in my ipad 4, I wanted to make some music through it but some loops are not there in it as compared to mac eg:beats n all. I wanted to know how to add it or find it in the application. Thank you.

  • DVD Player won't open in Full Screen Mode

    I'm trying to run an unattended DVD during our opening hours and have everything set up to run automatically except for this. I've checked all the appropriate boxes in the DVD player preferences (Open in Full Screen mode, start DVD upon player openin

  • Vim not displaying CKJ text

    even though vim is compiled with multibyte support and multilang, most of the Japanese, or Korean text is displayed as question marks, tildas, and other symbols. Some parts of the text are displayed correctly. Any where i should look to make changes?

  • How to pushdown concate operations in BODS

    Friends, I want to achieve full push down while concatenating two or more strings in BODS. For example, I have two fields First_Name and Last_Name and want to form a third field as Full_Name, concatenating First Name and Last Name. If I map this as F

  • Installing Photoshop on another computer will it cost me extra

    My laptop broke that had the Photoshop that i pay for on it, so i got a new laptop and wanted to install Photoshop on this laptop as I cant get on to the other laptop at all. Will it charge me twice for having photoshop on 2 laptops?