0
我在窗体中有两个字段。我在第一个字段中应用了使用javascript的各种自定义验证。因此,如果用户输入的值失败,我想在字段下方显示Error meassage但这里的问题是用户可以使用“添加行”按钮添加尽可能多的行。假设用户添加了3行。并且错误在第二行,“错误值”消息应该显示在下面第二行的字段。以下是我的代码中的一部分form.o如何显示错误使用JavaScript单独(不使用控制器类)。请帮助。在Visualforce页面的字段下方添加错误消息
<apex:outputPanel id="List">
<div id="repayid">
<table style="width:100%;display: block;overflow: scroll;" id="Table">
<tr id="Tabletr1">
<td class="A">Alpha No</td>
<td class="A">BetaText</td>
</tr>
<apex:repeat value="{!List}" var="rep" id="addrow">
<tr id="repayTabletr2">
<td id ="tdid">
<apex:inputField value="{!rep.S_Code_No__c}" id="barid" style="width:100%;"/>
<div style="color:red; background-color:white;">
<p class="SError" style="display:none;">Error Value </p>
</div>
</td>
<td>
<apex:inputField styleClass="RequiredField" value="{!rep.C_Code__c}" style="width:100%;"/>
<div style="color:red; background-color:white;"></div>
</td>
</tr>
</apex:repeat>
</table>
</div>
你找到答案了吗? –