I would like to create a regex pattern in javascript for a \[code\]html text field\[/code\] that takes an address. So I only want the user to enter \[code\][a-z,A-Z,0-9]\[/code\] and only these symbols \[code\][,#-.]\[/code\] I also want to prevent the user from sending an empty string and the maximum number of characters to be less than 100.This is the html \[code\]<input>\[/code\]:\[code\]<input type="text" id="addy" maxlength="100"/>\[/code\]I'm new to javascript, so I do not know how to create a function that will enable the regex patterns to be adhered to.ThanksEDIT Following the recommendation by \[code\]kolink\[/code\] I tried this:\[code\] <form id="newForm"> <select name="countries" id="codes"> <option value="http://stackoverflow.com/questions/14076214/USA">US</option> <option value="http://stackoverflow.com/questions/14076214/GBR">UK</option> <option value="http://stackoverflow.com/questions/14076214/GER">GERMANY</option> </select> <input type="text"name="address0" id="addy" pattern="^[ a-zA-Z0-9,#.-]+$" maxlength="100" title="Standard address/> <input type="submit" id="send "value="http://stackoverflow.com/questions/14076214/Submit" /></form>\[/code\]This still doesn't pick up the regex patterns. However the example at http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_input_pattern does work.Thanks