diff --git a/src/components/CreateServer/CreateServer.jsx b/src/components/CreateServer/CreateServer.jsx index 9b7341b..814a15a 100644 --- a/src/components/CreateServer/CreateServer.jsx +++ b/src/components/CreateServer/CreateServer.jsx @@ -46,6 +46,10 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer } }; + const validateInput = (input) => { + return input.replace(/[^a-zA-Z]/g, ''); + }; + return (
{noServers ? ( @@ -68,7 +72,7 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer className={styles.inputsubdomain} type="text" value={subdomainInput} - onChange={(e) => setSubdomainInput(e.target.value)} + onChange={(e) => setSubdomainInput(validateInput(e.target.value))} placeholder='Nom du sous domaine' />