How to use maxLength

how do you use the maxLength code to the set the maximum length of a textbox connected to a dataset? I’ve read through this link but am too new to Javascript to understand exactly how this works:

any and all input would be greatly appreciated!