-2

I created a chat system using php.

For the chat box I used Input text box. wheneve I try to send a message, previous msg that I sent start to show on top of the box.the demo of the problem

as you can see that previous 2 messages are showing on top of the input box.

I don't want this.

I have used thia code for input

    <input style="padding:4px;" id="msgCont" type="text" placeholder="Message..." class="inputText w95" />

please help me to remove this recommend data.

Ryan M
  • 18,333
  • 31
  • 67
  • 74

4 Answers4

0

Add the autocomplete="off" attribute:

<input 
  autocomplete="off"
  style="padding:4px;"
  id="msgCont"
  type="text"
  placeholder="Message..."
  class="inputText w95"
/>
AKX
  • 152,115
  • 15
  • 115
  • 172
  • 1
    `autocomplete="off"` doesn't work in the more recent versions of Chrome –  Aug 03 '20 at 08:03
0

Turn off the autocomplete attribute:

<input style="padding:4px;" id="msgCont" type="text" placeholder="Message..." class="inputText w95" autocomplete="off"/>
Andrew Arthur
  • 1,563
  • 2
  • 11
  • 17
0

This is quite simple. In the HTML you can put this: autocomplete="nofill". autocomplete="off" doesn't work in the more recent versions of Chrome. Check out this StackOverFlow post.

  • `autocomplete="nofill"` is not in the MDN spec at all, though. I don't think Firefox or other browsers would honor that unknown value. – AKX Aug 03 '20 at 08:04
  • @AKX You're right with the MDN, but when it comes to the browsers your wrong. It seems to work in all browsers. This isn't just the case with `nofill` but also with `true` and `false` –  Aug 03 '20 at 08:12
0

It'll be fixed as soon as you put in a single code. This is it.

<input type="text" autocomplete="off" />

Or if you're using a formtag, you can insert it into the formtag.

<form autocomplete="off">
  <input type="text" />
</form>
Dharman
  • 30,962
  • 25
  • 85
  • 135