0

My login screen have username and password textbox and submit button. Focus is set to Username textbox on page load. But on clicking submit button username textbox returns null value even if it has value. It is not happening with IE. If a keypress or mouseclick is done after page load, then username textbox will return the correct value.

Any help will be appreciated.

2
  • show us your code to make sure where gone wrong Commented Feb 22, 2018 at 6:07
  • @Kasnady..apologies for not sharing code because of organization policy... the logic behind the code is just taking the textbox value (textboxid.GetValue()) using jquery. If I am clicking once in textbox after page load, it works fine. If there is no other click events, it throws null in the 1st textbox entry. Is this a known issue? could you please help to make a mouse click on the username textbox using javascript after page load. Commented Feb 22, 2018 at 6:34

1 Answer 1

1

Try using

<form>
    <input type="text" placeholder="username" id="username">
    <input type="text" placeholder="password" id="password">
    <input type="submit" id="submit" value="Send Message">
</form>

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_form_submit

If you provide a little bit more information about your project i could help you with the handling of the code (php, ajax etc)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.