You need to sign in to do that
Don't have an account?
simon chao
prevent page from loading if error occurred
Hi, I currently have the code below
<td data-label="TESTING"><lightning:input type="number" min="0" label="" name=" " value="{!v.testint.test__c}"/></td>
I don't want any decimals, so if there is a decial a error will show up, as seen in the pic below
I also have a Next button at the bottom of the page. Is it possible to make the page stay on the current page when a error such as the above shows up? And only allow the page to go to the next section when the number have been changed from a decimal to a whole number, or when there are no errors shown.
<td data-label="TESTING"><lightning:input type="number" min="0" label="" name=" " value="{!v.testint.test__c}"/></td>
I don't want any decimals, so if there is a decial a error will show up, as seen in the pic below
I also have a Next button at the bottom of the page. Is it possible to make the page stay on the current page when a error such as the above shows up? And only allow the page to go to the next section when the number have been changed from a decimal to a whole number, or when there are no errors shown.
All Answers
<aura:if isTrue="{!v.testint.test__c gt 1}">
<tr class="rowTable">
<td data-label="TESTING"><lightning:input type="number" min="0" label="" name=" " value="{!v.testint.test__c}"/></td>
<td data-label="TESTING"><lightning:input type="number" min="0" label="" name=" " value="{!v.testint1.test__c}"/></td>
<td data-label="TESTING"><lightning:input type="number" min="0" label="" name=" " value="{!v.testint2.test__c}"/></td>
</tr>
</aura:if>
I should split up the lightning inputs into separate aura sections right? Because I currently have them in a row.
I tried with just one lightning input but that doesn't work either.
can i add a onclick="{!doAction}" within the lightning input? and from my controller side i will have
doAction :function(cmp)
{
check for whole number, if not display error?
}