0

code is very simple:

<form method="get" action="/category" role="form">
    <div class="form-group">
        <label>Category</label>
        <input id="categoryName" class="form-control" placeholder="category name" name="categoryName">
    </div>
    <button type="submit" class="btn btn-default" onclick="return checkInput()">add</button>
</form>

Problem is after I click the input, then chrome shows a select list which has input history below it. When I choose one of them and submit, I cannot get the value. I am a new student in web, anyone can help?

detail is like this picture: enter image description here

Rápli András
  • 3,869
  • 1
  • 35
  • 55
machinezhou
  • 679
  • 2
  • 6
  • 16
  • This is actually a "feature" of chrome. Since it's a password field, you can't access its value from JavaScript. Read the second answer on the marked duplicate to find more. – Madara's Ghost Dec 14 '16 at 17:03
  • I'm not get it from js but finally I found out it's the browser's cache prevent the form's action being sent to server. – machinezhou Dec 15 '16 at 03:32

0 Answers0