In google chrome there is something called Inspect element,you access it by pressing f12 or rigth click Inspect element.
So i have a from
<form>
<textarea name="title" id="title" maxlength="120"/></textarea>
</form>
So now if use Inpect element and edit the page and change the maxlenght to 500 i can send data bigger than 120.So how can i make sure that the data is 120 even if the user edit the page with Inpect element
If i use javascript to chek the length still the user can edit the javascript as well
You should always check the submitted data server-side. Trust nothing the user submits.
[Off-topic] Also be careful not to allow any kind of injection (client scripts, SQL, anything that the server or another user’s browser could accidentally execute)