Question: We currently have a React Web app. We'd like to be able to add WordPress in a subdirectory of the application. So for example:

* The react app lives on <https://examplesite.com>
* We would like WordPress installed on <https://examplesite.com/blog>

Currently our app is containerized on AWS.

How would we go about doing this?

Answer: 
First of all, client-side form validation is the greatest feature coming with the HTML5. Client-side form validation helps you to ensure data submitted matches the requirements. To get more detail about it you can visit [here](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation).

Important Note
--------------

Client-side form validation is an initial check, You should not use data coming from the form on the server side without checking it. It just a feature for good user experience. Because client-side validation is too easy to manipulate, so users can still easily send data that you do not want to on your server.

Solution
--------

In this question, the best solution is; using HTML attribute **pattern**. The `pattern` attribute defines a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp?retiredLocale=tr) the form control's value should match. To get more detail about `pattern` attribute you can visit the [this](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) page.

Below regexp you need.

> 
> ^[a-zA-Z0-9]{5,12}$
> 
> 
> 

It works like that;

* It should contains only alphanumeric.
* Minumum 5 and maximum 10
character.

You can use below code to integrate it with input field.

```html
<form action="">
    <input type="text" name="name" required
           pattern="[a-zA-Z0-9]{5,12}" title="No special character">
    <input type="submit">
</form>
```
Usually, to check inputs from html tags, you can create a javascript function to check your needs which is called everytime the user type in your input with the "onkeyup()" function.

The "onkeyup" keyword will trigger the function everytime user type in your field

```
<input type="text" onkeyup="myFunctionToCheck()">
<script>

    myFunctionToCheck(){
        //Here check your needs
    }

</script>

```