- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2024 03:53 AM
I need to check whether the number field has even or odd value. If it is even then I need to display the message that field has even value.
Here is my script:
function onLoad() {
//alert("You opend the boom form ");
var fieldValue=g_form.getValue('Number');
if(fieldValue % 2 === 0){
alert('The number field contains EVEN value');
}
}
but I am getting alert message for both even and odd values.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2024 04:05 AM
Hi @1__SathvikT you would need onChange client script, not onload.
onload will work only for the first time when the form loads.
script:
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2024 04:05 AM
Hi @1__SathvikT you would need onChange client script, not onload.
onload will work only for the first time when the form loads.
script:
Harish