Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

487
Views
Material UI TextField Regex

I need two textbox from TextField from MaterialUI one that can only enter alphabets(small or capital can also include spaces {Example : Risha Raj} as first textfield) and other one is also except only alphabets (small or capital) but with maxLength with only 3

so I did the following

           <TextField
            id='Product Name'
            label='Enter Student  Name'
            name='sname'
            value={values.sname}
            onChange={handleChange}
            error={errors.sname}
          />
            <TextField
            id='section'
            label='Enter Class Section'
            name='ccode'
            inputProps={{maxLength:3}}
            value={values.ccode}
            onChange={handleChange}
            error={errors.ccode}
          />

I am able to restrict the length but unable to do the alphabets

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This has nothing to do with Material UI.

You need to create a validator function on your handleChange.

See: How to set input alphanumeric value format in input field reactjs?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!