Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:11:46+00:00 2026-06-04T09:11:46+00:00

The problem I’m having is that I have a default value in a field,

  • 0

The problem I’m having is that I have a default value in a field, “0.00,” that shows the user the format that is valid. I can use placeholder, but that disappears on autofocus. The default value is also controlled by javascript.

When the page loads, the autofocus is active for a split second, and then the default value is put into the field and autofocus disappears. So is there a way to:

a) Force autofocus on fields with values or
b) force autofocus to take effect after everything loads, including javascript?

I have already tried the regular <input id="field" autofocus="autofocus" value="{{code}} /> and the document.getElementById("field").focus();.

EDIT:

Okay. So it was a fault on my own. I was thinking my mask js was the culprit in this and then started thinking, the default value appears, the autofocus cursor appears, then it disappears when the page is fully loaded. So in that order, something other than the masking js is causing the autofocus to disappear. So I figured out that since I’m also using the jquery form wizard, and it’s set to focusFirstInput:true, that it’s removing my HTML5 autofocus and affixing it to the first input, which is a disabled field.

Fixed the problem. Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:11:47+00:00Added an answer on June 4, 2026 at 9:11 am

    Okay. So it was a fault on my own. I was thinking my mask js was the culprit in this and then started thinking, the default value appears, the autofocus cursor appears, then it disappears when the page is fully loaded. So in that order, something other than the masking js is causing the autofocus to disappear. So I figured out that since I’m also using the jquery form wizard, and it’s set to focusFirstInput:true, that it’s removing my HTML5 autofocus and affixing it to the first input, which is a disabled field.

    Fixed the problem. Thanks for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have 2 classes, DB class and a User class, that will work
Problem background: I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a
Problem: I have an address field from an Access database which has been converted
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem I have a protobuf message definition with a MessageType field, which is an
Problem: When adding list item the Value field is being set to the Text
Problem is that application closes without any error, VS stays opened. I have multiple
Problem: I have a monitor program in Python that uses subprocess' Popen to start
Problem: to combine PATHs with filenames, such that I can easily source many files.
Problem I want to validate a field using a custom validator I've created that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.