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

156
Views
How to Insert dot(.) again in textarea, if we have created a function to replace it?

I have created a function to replace dot(.) into purnviraam, it works fine. but If we need to insert " . " again in textarea, I have created a button neart textarea with function. it inserts dot"." but pressing shift, it also converts in purnviraam. Please guide me, I don't have much knowledge of js coding.

$(function() {
  $('textarea').on("keyup", function(e) {
    var val = $(this).val();
    var str = val.replace('.', String.fromCharCode(2404));
    $(this).val(str);
  });
});


function myFunction1() {
  insertfullstop.data.value += '.';
  document.getElementById("data").focus();
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table>
  <tr>
    <td colspan="1">
      <form id="insertfullstop">
        <textarea type='text' id="data" class="js-copytextarea" style="width: 100%; max-width: 400px; height: 200px; border-radius: 6px 6px 6px 6px;" name="data" autofocus="" placeholder="Start Type Here................"></textarea>
      </form>
    </td>
  </tr>
  <tr align="right">
    <td style="padding-top: 5px; float='center' padding-left: 1px; " colspan="1">
      <strong style="font-size: 16px;"></strong>
      <button id="fullstop" OnClick="myFunction1()" class="btn1" title="Full Stop" type="button">.</button>
    </td>
  </tr>
</table>

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

0

The problem is that you replace . with | on EVERY keyup event, which means that; you can add the dot with your function correctly but when you type the textarea it is going to replace the previously added dot with |

To solve this: check if the typed character is a dot or not. If it is a dot, only then, replace it with a |. This way, it will not replace the previously added dot.

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!