• Resolved John

    (@elliott101)


    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.

    (@fernashes)

    Automattic Happiness Engineer

    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

    (@elliott101)

    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.

    (@fernashes)

    Automattic Happiness Engineer

    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

    (@elliott101)

    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.

    Plugin Support con

    (@conschneider)

    Engineer

    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.www.ads-software.com/Function_Reference/wpautop#Disabling_the_filter – but I reckon that is not quite what you are referring to.

    Thread Starter John

    (@elliott101)

    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.