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

100
Views
Modal Input extract initials only

I have a modal input with 2 fields. One is the text input for the full name and the second is a disabled field to get the live result. The result is the Capitalized letter of each word in the input text field 1. I have no clue on how to go about doing this, any thoughts or ideas?

$(function() {
                var $src = $('#inputClientName'),
                  $dst = $('#disabledinputClientCode');
                $src.on('input', function() {
                  $dst.val($src.val());
                });
              });

//This is what I tested:
//match(/(\b\S)?/g).join("").toUpperCase()

This code lets me copy the input into the destination text block. I tried using the test code above and could not get the desired result. Please help.

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

0

I think easiest would be to use a Regex. Something like this should do the job:

const input = "This Is Some Test";
const output = input.match(/[A-Z]/g);

console.log(output);

about 4 years ago · Juan Pablo Isaza Report

0

You can use CSS to do that. There is a CSS prop: text-transform (docs here). When you add text-transform: capitalize; to the styling of the input it will capitalize each word. Now all you have to do is set the value of the first input to be equal to the value of the second input.

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!