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

363
Views
Angular Textbox Undefined

So I'm trying to programmatically edit a textbox in a webpage through chromes developer console.

This is the code of the textbox.

<input formcontrolname="username" placeholder="Username" type="text" required="" class="form-control ng-untouched ng-pristine ng-invalid">

And here is my code to edit the textbox

document.forms[0].elements[0].id = "boxUsername"; 
document.getElementById("boxUsername").value = "My value";

Though when I try to log in afterward when the textbox visually has text in it. the page says that the textbox is null and there is no text in it. I'm very confused why this is happening considering the autofill function on chrome sets the value correctly and allows me to log in but when I'm trying to do it manually it won't work.

The page is made with Angular if that is important

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!