Angular [必需]不起作用,有条件的要求

时间:2018-12-13 17:45:47

标签: angular required

<apex:page standardController="RMA__c">
<apex:form >
    <apex:outputPanel id="thePanel" rendered="{!(RMA__c.RLI_has_QUOTE_SO__c == true)}">
    <apex:pageBlock id="TheBlock" title="Confirm Information" mode="edit">
        <apex:pageBlockSection id="theSection" title="Confirm the  new field values" columns="2" rendered="{!(RMA__c.Show_the_box__c == true)}">
            <apex:outputfield value="{!RMA__c.Contact__c}"/>
            <apex:outputfield value="{!RMA__c.Shipping_Priority__c}"/>
            <apex:outputfield value="{!RMA__c.Ship_to_Address__c}"/>
            <apex:outputfield value="{!RMA__c.Bill_to_Address__c}"/>
            <apex:inputfield value="{!RMA__c.Request_Priority__c}"/>
            <apex:inputField id="reviewed" value="{!RMA__c.Changes_are_reviewed__c}"/> 
        </apex:pageBlockSection>
        <apex:pageblockButtons id="button">
        <apex:commandButton value="Submit" action="{!save}" id="saveit" disabled="true"/>
        </apex:pageblockButtons>
        <script>
         var checker = document.getElementById("{!$Component.TheBlock.theSection.reviewed}");
         var sendbtn = document.getElementById("{!$Component.TheBlock.button.saveit}");
         checker.onchange = function()
         {
          if(this.checked)
          {
            sendbtn.disabled = false;
          } 
          else 
          {
            sendbtn.disabled = true;
          }
         }
       </script>
   </apex:pageBlock>
    </apex:outputPanel>
</apex:form>

您好,只想检查一下这行代码是否正确,因为它似乎不起作用!抱歉,这是一个简单的问题,但我是编码新手,似乎找不到最能满足我需求的答案!谢谢大家。

当试图在不需要的条形码中选择“ this”或“ that”时,我试图将条形码作为条件性要求。

1 个答案:

答案 0 :(得分:0)

您需要编写[attr.required]="your conditions",您可以像这样使用的所有本机HTML元素属性。