FAQ: I want to perform my own input validation and display a message based on the results
## Answer
Please use "「Script」".
---
## Overview
If you want to perform your input validation in "「Script」", please implement your input validation and result message display process in [$p.events.before_validate](/en/manual/script-events-before-validate) of the event firing script.
## Operation Procedure
1. Please enable the Number A item from the Editor tab.
1. Create a new "「Script」", write the script's contents below, and check "Edit" for the output destination to update. 
1.  Create a new record, enter a blank or a value other than 100 in Number A on the editing screen, and press the "Update" button.
### Execution Result


## Sample Code
##### JavaScript
```
$p.events.before_validate_Update = function (args) {
    var myNumA = $p.getControl('NumA').val()
    if (myNumA == "") {
        $p.clearMessage();
        $p.setMessage('#Message', JSON.stringify({
            Css: 'alert-warning',
            Text: 'No value entered. Please enter a number.'
        }));
        return false; //If false, processing stops and no update occurs
    } else if (myNumA != 100) {
        $p.clearMessage();
        $p.setMessage('#Message', JSON.stringify({
            Css: 'alert-error',
            Text: 'Please enter the number 100.'
        }));
        return false; //If false, processing stops and the value is not updated
    } else {
        return true; //If true, the value is updated
    }
}
````
## Related Information
<div id="ManualList">
    <article class="s-blog_list_unit"><h2>
        <h2>The specified information was not found.</h2>
        <p><a href="/ja/manual">Return to top</a></p>
    </article>
</div><input id="SearchTextHidden" type="hidden" value="" />
                    