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

210
Views
How to fill text field using JavaScript?

I am trying to open a webpage from my JavaScript function:

function fillText() {   
      window.open("https://Somerandonwebsite.com/task");      
  }

The webpage : "https://Somerandonwebsite.com/task" has a text box with the following tag:

<input type="text" id="titleBox" autocomplete="off" aria-label="Title Field" title="" placeholder="Enter Title" aria-invalid="true">

I want to add string "Title created" to the text box with the id titleBox

How can I achieve this in the function? I am also confused whether to add the string first and open webpage or open webpage and access text box to fill my string

How can I access text box to fill this string into the text box on opening web page?

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

0

As @Carsten Løvbo Andersen's comment said if you own both sites, you can just pass some query strings from your function to your site. E.G.

function fillText() {   
  window.open("https://Somerandonwebsite.com/task?string=yourString");
}      

Then, at your Somerandonwebsite.com, simply create a script:

var input = document.getElementById("titleBox");
const params = new URLSearchParams(window.location.search)
input.value = params.get("string")

This will make your text box display your query string named string

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!