Hi, I have two fields "Barcode" and "Count" on a submission datapage. I'm trying to make it so that if Barcode = "Yes", then the value in Count must always be 1. If the value in Barcode = "No" then the value in Count can be any positive integer.
Here's my failed attempt:-
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event)
{document.querySelector("[id*='InsertRecordBarcode_ID']").addEventListener('mousemove', function()
let BarVal = {document.querySelector("[id*='InsertRecordBarcode']").value
if BarVal.value == "Yes");{document.querySelector("[id*='InsertRecordCount']").value = "1"
};
</script>
Javescript isn't my native language and I'm really struggling with this so any help would be really appreciated.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
RonAnderson
Hi, I have two fields "Barcode" and "Count" on a submission datapage. I'm trying to make it so that if Barcode = "Yes", then the value in Count must always be 1. If the value in Barcode = "No" then the value in Count can be any positive integer.
Here's my failed attempt:-
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event)
{document.querySelector("[id*='InsertRecordBarcode_ID']").addEventListener('mousemove', function()
let BarVal = {document.querySelector("[id*='InsertRecordBarcode']").value
if BarVal.value == "Yes");{document.querySelector("[id*='InsertRecordCount']").value = "1"
};
</script>
Javescript isn't my native language and I'm really struggling with this so any help would be really appreciated.
Best regards
Ron Anderson
Link to comment
Share on other sites
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.