Jump to content

Repeating Characters in Textarea / Text Boxes


shogosprings

Recommended Posts

When running 

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

in IE 11, I get the following results.

"usrtxt=At W3Schools you w will find free Web-b building tutorials." 

Notice the characters which are being repeated.  How do I eliminate what we have come to call digital stuttering?

Thank you!

Link to comment
Share on other sites

I've managed to reproduce this.

Fix is at end.

The error is surrounding the 'hard' wrap attribute. It seems that the  new line characters created don't play well and differing browser behaviours are observed.

Internet Explorer seems to have an interesting time dealing with the new line characters. 

IE Query Sent

usrtxt: At+W3Schools+you+w%0D%0Awill+find+free+Web-b%0D%0Abuilding+tutorials.%0D%0A

When I moved the cursor around in IE to see if I could find these hidden characters, I ran into some weird behaviour (found a character, tried to go over it again, didn't work) and ended up with this being sent (NOTE THE ADDITIONAL "WILL", but the additional B is gone)

usrtxt: At+W3Schools+you+will%0D%0Awill+find+free+Web-%0D%0Abuilding+tutorials.%0D%0A

Chrome Query Sent

usrtxt: At+W3Schools+you+%0D%0Awill+find+free+Web-%0D%0Abuilding+tutorials.%0D%0A

 

I would instead use wrap=soft, and wrap on output instead. There really isn't very many scenarios where you need to use wrap=hard. (I personally haven't found any)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...