0

I am trying to populate a text input field using javascript based text the user clicks on within a grid.

The user can select text within a grid cell and select text from multiple grid cells. To handle multi-grid cell selection I would like to insert a control character as a separator as the input text can contain any character.

Firefox and IE allow me inserting a control character and I have been using \x12 Form-feed.

However, testing on Chrome the control character and all text after it fails to enter the text input field.

Is there a list of control characters which are accepted by Chrome or an alternative solution?

Andrew
  • 1,179
  • 8
  • 15
  • Pipe (|) is a common separator to use? – Matthew Riches Sep 20 '13 at 10:42
  • Thanks, but I have no control over the text in the field, it can theoretically contain any character that can be typed and can be in any language...|~ or any other character could be in the text at this stage. – Andrew Sep 20 '13 at 11:14

1 Answers1

0

I have discovered that TEXTAREA does allow JavaScript inserting control characters. This means I can have a hidden textarea field and a visible input field and cross update them. This is pretty messy as solutions go, but at least the page now works in Chrome.

If there is a better solution or a way to force Chrome to accept control characters in input fields like FF and IE I would love to know it.

Andrew
  • 1,179
  • 8
  • 15