Title: keyboard keycode substitution
Last modified: July 11, 2018

---

# keyboard keycode substitution

 *  Resolved [John](https://wordpress.org/support/users/elliott101/)
 * (@elliott101)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/)
 * I am looking for a way to replace ASCII(32) with ASCII(255) in TEXT or TEXTAREA
   for customer customization entry.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [7 years, 10 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10486948)
 * > I am looking for a way to replace ASCII(32) with ASCII(255) in TEXT or TEXTAREA
   > for customer customization entry.
 * It sounds like you’d like to make shorter fields into a longer field to allow
   customers to enter more information. Which fields are you looking to change?
 *  Thread Starter [John](https://wordpress.org/support/users/elliott101/)
 * (@elliott101)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10488092)
 * I am not trying to change field length. I have TEXT and TEXTAREA fields for customers
   to input information that may include multiple spaces (ASCII(32)). HTML only 
   allows 1 space to pass through to the shopping cart and emails. By replacing 
   ASCII(32) with ASCII(255) I change the space to the   ASCII code and multiple
   spaces are allowed. This works if I enter ALT(255) from the keyboard instead 
   of using the spacebar.
 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [7 years, 10 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10493461)
 * Okay, let’s take a step back. I asked what you’re looking to do, as changing 
   field types is something that would need to happen in the database and could 
   become complex. Depending on what your end goal is, there may be an easier way.
 * What exactly would you like to achieve by making this change?
 *  Thread Starter [John](https://wordpress.org/support/users/elliott101/)
 * (@elliott101)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10493962)
 * I am not wanting to change field type. I am using the TEXT and/or TEXTAREA of
   a plugin to capture customer customization. The spacebar is used to position 
   text withing the TEXT/TEXTAREA but HTML removes all but one space. By replace
   the ASCII(32) spacebar with ASCII(255), essentially  , I can retain customer 
   formatting on TEXT entry.
 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [7 years, 9 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10524356)
 * Hi John,
 * Could you provide more details to what it is you are doing exactly when you say”
   By replace the ASCII(32) spacebar with ASCII(255)”. I have no prior experience
   with this.
 * The only thing that comes to mind is that WordPress has an auto format feature
   which I needed to disable in the past as well. [https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter](https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter)–
   but I reckon that is not quite what you are referring to.
 *  Thread Starter [John](https://wordpress.org/support/users/elliott101/)
 * (@elliott101)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10524367)
 * As you know HTML does not process multiple spaces. I have a site where a customer
   can enter text, including multiple spaces, into a TEXT/TEXTAREA input. I want
   to keep the spaces by replacing the space (ASCII(32)) with the ASCII(0160) (the
   character) (citing ASCII(255) was my bad) thus maintain the customer whitespace
   formatting. This is a WooCommerce website.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘keyboard keycode substitution’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [John](https://wordpress.org/support/users/elliott101/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/keyboard-keycode-substitution/#post-10524367)
 * Status: resolved