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

213
Views
How can I configure "Enter key" while sending whatsapp message through HTML form?

so that user doesn't need to click enter button for sending message fetched from HTML page(form)?

<form onsubmit="gotowhatsapp()">
                    <input type="text" name="username" class="username form-control" placeholder="Name" id="name"
                        required />
                    <input type="email" name="Email" class="username form-control" placeholder="Email" id="email"
                        required />
                    <input type="tel" name="phone" class="username form-control" placeholder="Phone Number"
                        id="phone" pattern="[0-9]{10}"
                        oninvalid="this.setCustomValidity('Please Enter a valid Phone Number')"
                        oninput="this.setCustomValidity('')" required /><input class="btn" type="submit" name="submit" value="Submit" >
                </form> <script>
    function gotowhatsapp() {

        var name = document.getElementById("name").value;
        var phone = document.getElementById("phone").value;
        var email = document.getElementById("email").value;
        
        var url = "https://api.whatsapp.com/send?phone=761xxxxxxx&text="
            + "Name: " + name + "%0a"
            + "Phone: " + phone + "%0a"
            + "Email: " + email + "%0a"
       

        window.open(url, '_blank').focus();//**"here it redirects to whatsapp application but you need to press enter to send messege."**
    }
</script>

Is there any option to use "\n" so that it acts as "Enter key"? because I didn't find any solution to this yet.

about 4 years ago · Juan Pablo Isaza
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!